From patchwork Wed Nov 30 10:10:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 27713 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp840339wrr; Wed, 30 Nov 2022 02:23:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7N6bik/rA/bncu4CqqM34WRaPxRJncSJOpc+zikFXUQodGBvlObzqCxsDehTtM9bMu/Fbq X-Received: by 2002:a17:906:5583:b0:78d:b3ef:656c with SMTP id y3-20020a170906558300b0078db3ef656cmr34747274ejp.627.1669803805717; Wed, 30 Nov 2022 02:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669803805; cv=none; d=google.com; s=arc-20160816; b=nObQrDEyd5l77RAT74weQbaMCk+91FOEjSRZku315Yo3/5/O/J8SRFn+M6kKSQMk0H GU1kfMrgxoZ5pPdqKYUZugHvr79J/M8hPxQTebAFTt80RhUUCAUcyYFXSSFR7+QPb9R+ M4vQtPPbee4rNupnaaUJuX/4RQAPgEyhPLm+eWCCBMcevDKElcGIypEaQNVkXlns4Ty1 yIh9q+cn27Z8xEUvy60kNQJnt/qkCjcXtf3SHNxtpISaojnLSyg7QCVtGkjlJUjF9Kqz Z364db2UQY4Rr7CW1YK+nvo40sLM2hpO+eePlnQI/r3HjpBRN3H9bh1+CyAl4xJnaD2f ZA3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vcX4h7B4Cn2uY8DsNhXZd0MIAMkHSmKLkxFeut2xdUs=; b=JiYY2RM2sqCJrVWtRuYpLk7sSHmCrpzVh/cCsiC9WjTqtraQJmh5UCaofoPO0weez9 JQ/vlZ6tkqyA4RbfrebageWxDMR8VnkuyDEoeyo6FLKQRCEFU4U/PSisGjfJkVeWxI5R M1S0tk5ggEw1dS5ncmrIUuK5ckK8Ch+lduizjx0AzQ3y7DMVD5a0WsBiG4dnGCdg8jJ0 TaEz1+7BDGctYHTDX6HZtuNazef5ZN61M7iinH8QLkAASXMvwYXapP3XkTcglsKaXCaP v/DKuanWeTqCPF1dubzqE4BkKeI/vWEPzhmKxZlJ5HH5zSW76L9kq4KPYvI3wQ9RO2wx 9oSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bo1QeYRm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg39-20020a170907972700b007c09fda33c7si884960ejc.824.2022.11.30.02.23.02; Wed, 30 Nov 2022 02:23:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bo1QeYRm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235587AbiK3KME (ORCPT + 99 others); Wed, 30 Nov 2022 05:12:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235678AbiK3KL6 (ORCPT ); Wed, 30 Nov 2022 05:11:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A58FB32B8C for ; Wed, 30 Nov 2022 02:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669803055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vcX4h7B4Cn2uY8DsNhXZd0MIAMkHSmKLkxFeut2xdUs=; b=bo1QeYRmFl8wjGWCL4ReZe95FtPshmJ4lekS3XeQCVcAiJLfl99wB71wofLPiiiNd6jlNT E36Ai2YqFozufibn/jZm1mgu2SpS9IA98BS+q7poCls4yZZhcMOqJRAAikhmhWEDDBZHqC bKzKMi+B55or4VCQxZ9YDpuqFDjPFAQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-14-al01h2BcNG2dZSPCXBRCdQ-1; Wed, 30 Nov 2022 05:10:52 -0500 X-MC-Unique: al01h2BcNG2dZSPCXBRCdQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72A063804066; Wed, 30 Nov 2022 10:10:51 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.195.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D45540E978E; Wed, 30 Nov 2022 10:10:33 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 1/2] HID: bpf: enforce HID_BPF dependencies Date: Wed, 30 Nov 2022 11:10:20 +0100 Message-Id: <20221130101021.1868764-2-benjamin.tissoires@redhat.com> In-Reply-To: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> References: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750916195645639726?= X-GMAIL-MSGID: =?utf-8?q?1750916195645639726?= As mentioned in the link below, having JIT and BPF is not enough to have fmod_ret and error injection APIs. This resolves the error that happens on a system without tracing enabled when hid-bpf tries to load itself. Link: https://lore.kernel.org/r/CABRcYmKyRchQhabi1Vd9RcMQFCcb=EtWyEbFDFRTc-L-U8WhgA@mail.gmail.com Fixes: f5c27da4e3c8 ("HID: initial BPF implementation") Signed-off-by: Benjamin Tissoires Tested-by: Jon Hunter --- drivers/hid/bpf/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/bpf/Kconfig b/drivers/hid/bpf/Kconfig index 298634fc3335..498232f9faa9 100644 --- a/drivers/hid/bpf/Kconfig +++ b/drivers/hid/bpf/Kconfig @@ -4,7 +4,9 @@ menu "HID-BPF support" config HID_BPF bool "HID-BPF support" default HID_SUPPORT - depends on BPF && BPF_SYSCALL + depends on BPF && BPF_SYSCALL && \ + DYNAMIC_FTRACE_WITH_DIRECT_CALLS && \ + FUNCTION_ERROR_INJECTION help This option allows to support eBPF programs on the HID subsystem. eBPF programs can fix HID devices in a lighter way than a full