From patchwork Mon Dec 5 16:48:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 29780 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2363787wrr; Mon, 5 Dec 2022 08:55:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hmabrtLXyq/xB6U3WJy+HNEepfNhLh/VEMOcWgIfGZC8z3bqVAEmMzmQW2PhGuQqZR340 X-Received: by 2002:a50:aa8f:0:b0:469:c5cc:855e with SMTP id q15-20020a50aa8f000000b00469c5cc855emr62069348edc.307.1670259306355; Mon, 05 Dec 2022 08:55:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670259306; cv=none; d=google.com; s=arc-20160816; b=p/gldX9GRSy9oBb3wm+XjiTxntVy4sR+je5INeWiDj8B5VVqEfN2OtLOsZ2vVZw6b6 v98wxm2UR3KZD4uadoax5GpkrYtfXTRaP6LKckOEmd+15ydtznABu1Bshj70DNa4ulx4 k+4itNhTsR6BM/Ujoe2FTC5K168kE3JeEfFARQ2PW1uqC63TtsaUDj34K15/V8fblYzQ n5so/KYxGF5gh6Z5exC/vIqnPMtwMCcJINxSfpsilMYvs8bWDEpkWPshHDoEchDpNO2r KKCuSy0Vobd/EgJGhZeKfLvVfZVECFdKGRRZt9fTkbVpTR70mXzzeehJ/p/4qMnIm12m TeVA== 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=QsBvXKlr8/ZXxysANtnuvwsqOxsB1GOMFs9Y2NQRG7U=; b=FfB+BHnVUoJY4jaVPLAuu+7pLVRCNtbAiu5vnmZ4BWyV58mV5YRTBHwYgeYNmt0V0U Q6bEXyxCa3qYX3A38Olmaf0yL32ply6PAqDOXQcGyyN+cyvVnqWiPX6ajeSGTM64VwOB 5AsWsLE7aApElGJauC8wa7aeqGcse7LVBq3Bwi7vot+SkQh3/R/3AEDFwrbj5gJ5AKao vi0AZT68flDDE9e9xnvyOIlQD+jW/xmY+J8kLSkk1ERrlJhtP5RZAgAgE5n32v37Ex0T z+SVHufiQJyCWiHk95qTJkWDEEGoKN8YhEUp73AzsSSLyfJo7vyPDj0uOmEOwX6YYYLs NsFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MH4KddSR; 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 hv16-20020a17090760d000b0077eca9fa444si6459975ejc.187.2022.12.05.08.54.42; Mon, 05 Dec 2022 08:55:06 -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=MH4KddSR; 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 S230327AbiLEQvh (ORCPT + 99 others); Mon, 5 Dec 2022 11:51:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232896AbiLEQux (ORCPT ); Mon, 5 Dec 2022 11:50:53 -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 6D28A246 for ; Mon, 5 Dec 2022 08:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258948; 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=QsBvXKlr8/ZXxysANtnuvwsqOxsB1GOMFs9Y2NQRG7U=; b=MH4KddSR+WN9B3RdPNRMIGt4d9YC7HahxqT+8D00Sx5G+jp6ZeG0bWYfOIVdK6GTZJowbs zvIOP61xqfyVLO92MHu2QrbjAnshN8+oCcyINe96gNuBsnt5b5OONnXuzwcQpw0JrURJ+4 35n1cQ+VOYtLIvpY1haTPqia/LJU4dk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-442-XYIlecXDPXeDGSdCJ-LndA-1; Mon, 05 Dec 2022 11:49:05 -0500 X-MC-Unique: XYIlecXDPXeDGSdCJ-LndA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 057A2800B23; Mon, 5 Dec 2022 16:49:05 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 616F91401C20; Mon, 5 Dec 2022 16:49:03 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v2 1/4] bpf: do not rely on ALLOW_ERROR_INJECTION for fmod_ret Date: Mon, 5 Dec 2022 17:48:53 +0100 Message-Id: <20221205164856.705656-2-benjamin.tissoires@redhat.com> In-Reply-To: <20221205164856.705656-1-benjamin.tissoires@redhat.com> References: <20221205164856.705656-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=unavailable 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?1751393822520774713?= X-GMAIL-MSGID: =?utf-8?q?1751393822520774713?= The current way of expressing that a non-bpf kernel component is willing to accept that bpf programs can be attached to it and that they can change the return value is to abuse ALLOW_ERROR_INJECTION. This is debated in the link below, and the result is that it is not a reasonable thing to do. Reuse the kfunc declaration structure to also tag the kernel functions we want to be fmodret. This way we can control from any subsystem which functions are being modified by bpf without touching the verifier. Link: https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/ Suggested-by: Alexei Starovoitov Signed-off-by: Benjamin Tissoires --- include/linux/btf.h | 3 +++ kernel/bpf/btf.c | 41 +++++++++++++++++++++++++++++++++++++++++ kernel/bpf/verifier.c | 17 +++++++++++++++-- net/bpf/test_run.c | 14 +++++++++++--- 4 files changed, 70 insertions(+), 5 deletions(-) diff --git a/include/linux/btf.h b/include/linux/btf.h index f9aababc5d78..f71cfb20b9bf 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -412,8 +412,11 @@ struct btf *bpf_prog_get_target_btf(const struct bpf_prog *prog); u32 *btf_kfunc_id_set_contains(const struct btf *btf, enum bpf_prog_type prog_type, u32 kfunc_btf_id); +u32 *btf_kern_func_is_modify_return(const struct btf *btf, + u32 kfunc_btf_id); int register_btf_kfunc_id_set(enum bpf_prog_type prog_type, const struct btf_kfunc_id_set *s); +int register_btf_fmodret_id_set(const struct btf_kfunc_id_set *kset); s32 btf_find_dtor_kfunc(struct btf *btf, u32 btf_id); int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_cnt, struct module *owner); diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 35c07afac924..a22f3f45aca3 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -204,6 +204,7 @@ enum btf_kfunc_hook { BTF_KFUNC_HOOK_STRUCT_OPS, BTF_KFUNC_HOOK_TRACING, BTF_KFUNC_HOOK_SYSCALL, + BTF_KFUNC_HOOK_FMODRET, BTF_KFUNC_HOOK_MAX, }; @@ -7448,6 +7449,19 @@ u32 *btf_kfunc_id_set_contains(const struct btf *btf, return __btf_kfunc_id_set_contains(btf, hook, kfunc_btf_id); } +/* Caution: + * Reference to the module (obtained using btf_try_get_module) corresponding to + * the struct btf *MUST* be held when calling this function from verifier + * context. This is usually true as we stash references in prog's kfunc_btf_tab; + * keeping the reference for the duration of the call provides the necessary + * protection for looking up a well-formed btf->kfunc_set_tab. + */ +u32 *btf_kern_func_is_modify_return(const struct btf *btf, + u32 kfunc_btf_id) +{ + return __btf_kfunc_id_set_contains(btf, BTF_KFUNC_HOOK_FMODRET, kfunc_btf_id); +} + /* This function must be invoked only from initcalls/module init functions */ int register_btf_kfunc_id_set(enum bpf_prog_type prog_type, const struct btf_kfunc_id_set *kset) @@ -7478,6 +7492,33 @@ int register_btf_kfunc_id_set(enum bpf_prog_type prog_type, } EXPORT_SYMBOL_GPL(register_btf_kfunc_id_set); +/* This function must be invoked only from initcalls/module init functions */ +int register_btf_fmodret_id_set(const struct btf_kfunc_id_set *kset) +{ + struct btf *btf; + int ret; + + btf = btf_get_module_btf(kset->owner); + if (!btf) { + if (!kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) { + pr_err("missing vmlinux BTF, cannot register kfuncs\n"); + return -ENOENT; + } + if (kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) { + pr_err("missing module BTF, cannot register kfuncs\n"); + return -ENOENT; + } + return 0; + } + if (IS_ERR(btf)) + return PTR_ERR(btf); + + ret = btf_populate_kfunc_set(btf, BTF_KFUNC_HOOK_FMODRET, kset->set); + btf_put(btf); + return ret; +} +EXPORT_SYMBOL_GPL(register_btf_fmodret_id_set); + s32 btf_find_dtor_kfunc(struct btf *btf, u32 btf_id) { struct btf_id_dtor_kfunc_tab *tab = btf->dtor_kfunc_tab; diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 225666307bba..0525972de998 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -15021,12 +15021,22 @@ int bpf_check_attach_target(struct bpf_verifier_log *log, ret = -EINVAL; switch (prog->type) { case BPF_PROG_TYPE_TRACING: - /* fentry/fexit/fmod_ret progs can be sleepable only if they are + + /* fentry/fexit/fmod_ret progs can be sleepable if they are * attached to ALLOW_ERROR_INJECTION and are not in denylist. */ if (!check_non_sleepable_error_inject(btf_id) && within_error_injection_list(addr)) ret = 0; + /* fentry/fexit/fmod_ret progs can also be sleepable if they are + * in the fmodret id set with the KF_SLEEPABLE flag. + */ + else { + u32 *flags = btf_kern_func_is_modify_return(btf, btf_id); + + if (flags && (*flags & KF_SLEEPABLE)) + ret = 0; + } break; case BPF_PROG_TYPE_LSM: /* LSM progs check that they are attached to bpf_lsm_*() funcs. @@ -15047,7 +15057,10 @@ int bpf_check_attach_target(struct bpf_verifier_log *log, bpf_log(log, "can't modify return codes of BPF programs\n"); return -EINVAL; } - ret = check_attach_modify_return(addr, tname); + ret = -EINVAL; + if (btf_kern_func_is_modify_return(btf, btf_id) || + !check_attach_modify_return(addr, tname)) + ret = 0; if (ret) { bpf_log(log, "%s() is not modifiable\n", tname); return ret; diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 13d578ce2a09..5079fb089b5f 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -489,7 +489,6 @@ int noinline bpf_fentry_test1(int a) return a + 1; } EXPORT_SYMBOL_GPL(bpf_fentry_test1); -ALLOW_ERROR_INJECTION(bpf_fentry_test1, ERRNO); int noinline bpf_fentry_test2(int a, u64 b) { @@ -733,7 +732,15 @@ noinline void bpf_kfunc_call_test_destructive(void) __diag_pop(); -ALLOW_ERROR_INJECTION(bpf_modify_return_test, ERRNO); +BTF_SET8_START(bpf_test_modify_return_ids) +BTF_ID_FLAGS(func, bpf_modify_return_test) +BTF_ID_FLAGS(func, bpf_fentry_test1, KF_SLEEPABLE) +BTF_SET8_END(bpf_test_modify_return_ids) + +static const struct btf_kfunc_id_set bpf_test_modify_return_set = { + .owner = THIS_MODULE, + .set = &bpf_test_modify_return_ids, +}; BTF_SET8_START(test_sk_check_kfunc_ids) BTF_ID_FLAGS(func, bpf_kfunc_call_test1) @@ -1668,7 +1675,8 @@ static int __init bpf_prog_test_run_init(void) }; int ret; - ret = register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS, &bpf_prog_test_kfunc_set); + ret = register_btf_fmodret_id_set(&bpf_test_modify_return_set); + ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS, &bpf_prog_test_kfunc_set); ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &bpf_prog_test_kfunc_set); ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_SYSCALL, &bpf_prog_test_kfunc_set); return ret ?: register_btf_id_dtor_kfuncs(bpf_prog_test_dtor_kfunc, From patchwork Mon Dec 5 16:48:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 29775 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2363066wrr; Mon, 5 Dec 2022 08:53:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6pZR4BNdll43sJntSCQh3XjN1TofOBM3HNcqBTd9shuFpg6yQMRIiENHjC3XsSnW5HR61y X-Received: by 2002:a05:6402:381b:b0:456:ee32:799b with SMTP id es27-20020a056402381b00b00456ee32799bmr28403742edb.2.1670259200804; Mon, 05 Dec 2022 08:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670259200; cv=none; d=google.com; s=arc-20160816; b=CuPW66orOzqGnR1SmltXRmFCaQqXjK0cTiQjabAu2hc8FsBdqzNmOztHrjn32TQBwM 4LCY0DfO0/2OxuQWWTX4Igif+u6cBX4gu3YMKXGx7lGABl8E2zKwwW09VTxzN5Yw+STp YjjnDnR/0IC3cEBzjh9KB8E4u7bTKfKQnDl9BxSxirt9PTDqlE4XEFllzrUE28XkGWIm GhWjIConNMHvVQrJTt261z6pWWTvgPdffNmoAdZ9l88cA2+pZaV+LxfKy3s35IqEEwZK EsXXFg//OxwV0h5ZFl7ZvJgSGQDXs3wilrxKLcYQCPeORIQv3JsLp5MA1+umvvtxFJQg IE9w== 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=FCKqUZqZSIHQOgUFFHrFMu74VLZC7+QJip0yOsJ967s=; b=tyYT5pJa8wbNsiclWWzL5tnc3TcBmJq7MAUYvQKxpxlGICPxOOBvZzGQg0B1cNTuyg fRhakU8sDcCL0wmI3OUa1Vovb4C/AnbTM1CVd7tcoP44XZiQmtnpBhZXUr3CTyg0HeAG ovzl/ESQ5b2b3jjHzuDx7da9U22db6PNY2Yhn33wVF8f1bBo7tnm+xd9gC/tcN2Cu49C TpYQ5gwSWl1FTtGN5gELnyAiu5VjMqFciCaqhWpVkSnvjDzX12b5ZbxIv2xtT74NNls2 EXFzROUVDmANTtqNWHXahyRagPFSm3Jk4Z++0ugh9YVbDnXrPZl4+cXQt4N+wuzDcbFl fCAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N9wxAdVU; 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 i16-20020a1709064fd000b007b29ccd79c0si450650ejw.590.2022.12.05.08.52.49; Mon, 05 Dec 2022 08:53:20 -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=N9wxAdVU; 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 S231736AbiLEQva (ORCPT + 99 others); Mon, 5 Dec 2022 11:51:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbiLEQux (ORCPT ); Mon, 5 Dec 2022 11:50:53 -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 70483E35 for ; Mon, 5 Dec 2022 08:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258950; 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=FCKqUZqZSIHQOgUFFHrFMu74VLZC7+QJip0yOsJ967s=; b=N9wxAdVU+6CLnF0aixjHpzHPvA1Nm/guS4ocQX5mdHzTXq897dzXB8GAOTL62ebNH1U4S6 3cXCvxC2fBtZvZZ0TS/O6/x2wHc8j3RXGjdWD2EzSKK5oaBvy0Dew9qdfLMSTnmXL+6fb2 ysJwhZkwRuMEsF8KkDESBw1DvrGLBMo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-KmeCVZ2RPnGeAfkRdWnMQg-1; Mon, 05 Dec 2022 11:49:07 -0500 X-MC-Unique: KmeCVZ2RPnGeAfkRdWnMQg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D53AF185A78B; Mon, 5 Dec 2022 16:49:06 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F1F71410DD9; Mon, 5 Dec 2022 16:49:05 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v2 2/4] HID: bpf: do not rely on ALLOW_ERROR_INJECTION Date: Mon, 5 Dec 2022 17:48:54 +0100 Message-Id: <20221205164856.705656-3-benjamin.tissoires@redhat.com> In-Reply-To: <20221205164856.705656-1-benjamin.tissoires@redhat.com> References: <20221205164856.705656-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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?1751393711531238058?= X-GMAIL-MSGID: =?utf-8?q?1751393711531238058?= Now that we have aproper non debug API to declare which function is fmodret, we can rely on it. Link: https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/ Suggested-by: Alexei Starovoitov Signed-off-by: Benjamin Tissoires --- drivers/hid/bpf/hid_bpf_dispatch.c | 20 ++++++++++++++++++-- drivers/hid/bpf/hid_bpf_jmp_table.c | 1 - 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c index c3920c7964dc..58e608ebf0fa 100644 --- a/drivers/hid/bpf/hid_bpf_dispatch.c +++ b/drivers/hid/bpf/hid_bpf_dispatch.c @@ -44,7 +44,6 @@ __weak noinline int hid_bpf_device_event(struct hid_bpf_ctx *ctx) { return 0; } -ALLOW_ERROR_INJECTION(hid_bpf_device_event, ERRNO); u8 * dispatch_hid_bpf_device_event(struct hid_device *hdev, enum hid_report_type type, u8 *data, @@ -105,7 +104,6 @@ __weak noinline int hid_bpf_rdesc_fixup(struct hid_bpf_ctx *ctx) { return 0; } -ALLOW_ERROR_INJECTION(hid_bpf_rdesc_fixup, ERRNO); u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *size) { @@ -429,6 +427,18 @@ hid_bpf_hw_request(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz, return ret; } +/* our HID-BPF entrypoints */ +BTF_SET8_START(hid_bpf_fmodret_ids) +BTF_ID_FLAGS(func, hid_bpf_device_event) +BTF_ID_FLAGS(func, hid_bpf_rdesc_fixup) +BTF_ID_FLAGS(func, __hid_bpf_tail_call) +BTF_SET8_END(hid_bpf_fmodret_ids) + +static const struct btf_kfunc_id_set hid_bpf_fmodret_set = { + .owner = THIS_MODULE, + .set = &hid_bpf_fmodret_ids, +}; + /* for syscall HID-BPF */ BTF_SET8_START(hid_bpf_syscall_kfunc_ids) BTF_ID_FLAGS(func, hid_bpf_attach_prog) @@ -495,6 +505,12 @@ static int __init hid_bpf_init(void) * will not be available, so nobody will be able to use the functionality. */ + err = register_btf_fmodret_id_set(&hid_bpf_fmodret_set); + if (err) { + pr_warn("error while registering fmodret entrypoints: %d", err); + return 0; + } + err = register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &hid_bpf_kfunc_set); if (err) { pr_warn("error while setting HID BPF tracing kfuncs: %d", err); diff --git a/drivers/hid/bpf/hid_bpf_jmp_table.c b/drivers/hid/bpf/hid_bpf_jmp_table.c index 579a6c06906e..207972b028d9 100644 --- a/drivers/hid/bpf/hid_bpf_jmp_table.c +++ b/drivers/hid/bpf/hid_bpf_jmp_table.c @@ -103,7 +103,6 @@ __weak noinline int __hid_bpf_tail_call(struct hid_bpf_ctx *ctx) { return 0; } -ALLOW_ERROR_INJECTION(__hid_bpf_tail_call, ERRNO); int hid_bpf_prog_run(struct hid_device *hdev, enum hid_bpf_prog_type type, struct hid_bpf_ctx_kern *ctx_kern) From patchwork Mon Dec 5 16:48:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 29776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2363163wrr; Mon, 5 Dec 2022 08:53:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Bk6v/sfpKEZHYxF4XV/DD3GUxsN1aG8mLyQAZa3dxy/DgYuxRM8NSjWVR8DewJS/FJgzi X-Received: by 2002:a17:906:a147:b0:7b2:7b45:2cd2 with SMTP id bu7-20020a170906a14700b007b27b452cd2mr70451076ejb.615.1670259214706; Mon, 05 Dec 2022 08:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670259214; cv=none; d=google.com; s=arc-20160816; b=zf1HJ5FZCCOV/6ELmE6ktvuIPWB7cUO9PABVOfQ1njuFgKs6ZvrAznzhLVDwJccq/s Ol1DJctDBKrN/FS/5DzjHlks3wgTseWB4WMoJJ6vywyU3nXSOGdUQtNXIdIEFjkzSzLs JA+zHJqshVBFdP7KC1UVH1gPIuEQtaB/cWidqeXfOAq7oDamDQD66ei5L7XLA2WbLPJp 5w/Roj3FRgIEzOQ+ZrqrC/sCI9nvnqBrXRAjYByt06qBuLY9UHUL7pFVkWGLVZdUg6jY 9V/vSqiItr66h8p0nIo1U3HquXCKopXfV0EmXY9GfLU7a7AKCIfHfZFX8Tfua40XFw7c wrsw== 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=/we/TY9X/UjbEuq3HgYT/C/G2oJ1wSnJ8iPzmf0TirQ=; b=gQK1C2/rPoyiHf+Xeg2cDUk7XsGq0i1hNckQIaD8cq09S6DdosKSbySQXJafUZUUnU wDapIpfzJ3HpQIKENRyrE+cEkLCKZgpVtao/745VPlOnDjYIQcRTFMAjETqEpoMy160f rOgXpNyVfg+VytkjUOff0Ir3XpXqapH+LGLK7T3Di7/o1QM3m+S5XjgiuoYMJ6RyuHVI WQRK0VG+uY+W3byHxeV9eYoBVyAoBfPyKrKkH5Yxo6NySkvJKjzlZYKh/ZpGHIq4rQyU aVXRu5m2Bxd62A1h/SmI4SkJHaQEtyP1s7bi/0LzScotFU82fqJz07DVr5WZKUGVDicV nVRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Ec5wz5t/"; 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 cs14-20020a170906dc8e00b007c100ed5071si975728ejc.710.2022.12.05.08.53.11; Mon, 05 Dec 2022 08:53:34 -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="Ec5wz5t/"; 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 S231146AbiLEQwS (ORCPT + 99 others); Mon, 5 Dec 2022 11:52:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233221AbiLEQvP (ORCPT ); Mon, 5 Dec 2022 11:51:15 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58900D2E1 for ; Mon, 5 Dec 2022 08:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258954; 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=/we/TY9X/UjbEuq3HgYT/C/G2oJ1wSnJ8iPzmf0TirQ=; b=Ec5wz5t/bXlrKxYvx1gRC8hKypSO6u0Q2Zts8jqpDY3cymOQFm2AKDPVvDLMlaCj4sb7FI ZRMTv+cE59W3gzzutLDKLUQPgSCKO8EdttOrv0TXGA9RDU7lAFjqYNm7FYX9+Vbn4CAe7P 17RGdq7UzJoC3inNkcGrLkc1aJP3IyA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-351-rezvupzTNJOOL9Gm4IAPAw-1; Mon, 05 Dec 2022 11:49:09 -0500 X-MC-Unique: rezvupzTNJOOL9Gm4IAPAw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2A7785A5A6; Mon, 5 Dec 2022 16:49:08 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BCE2141511A; Mon, 5 Dec 2022 16:49:06 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v2 3/4] HID: bpf: enforce HID_BPF dependencies Date: Mon, 5 Dec 2022 17:48:55 +0100 Message-Id: <20221205164856.705656-4-benjamin.tissoires@redhat.com> In-Reply-To: <20221205164856.705656-1-benjamin.tissoires@redhat.com> References: <20221205164856.705656-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=unavailable 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?1751393725993525920?= X-GMAIL-MSGID: =?utf-8?q?1751393725993525920?= As mentioned in the link below, having JIT and BPF is not enough to have fentry/fexit/fmod_ret 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 --- drivers/hid/bpf/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/bpf/Kconfig b/drivers/hid/bpf/Kconfig index 298634fc3335..03f52145b83b 100644 --- a/drivers/hid/bpf/Kconfig +++ b/drivers/hid/bpf/Kconfig @@ -4,7 +4,8 @@ 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 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 From patchwork Mon Dec 5 16:48:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 29777 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2363200wrr; Mon, 5 Dec 2022 08:53:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5kolCt8jNBMrD5xN3lkoofybJrKLVc69Ujkn+R3BDMJKOv3UJUISqaqkwFRHe1ENfU7ATL X-Received: by 2002:aa7:c98e:0:b0:46c:2cf2:e89f with SMTP id c14-20020aa7c98e000000b0046c2cf2e89fmr13457566edt.267.1670259219949; Mon, 05 Dec 2022 08:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670259219; cv=none; d=google.com; s=arc-20160816; b=bssJ/ilfhnqulEV6VI9k9ZVnMDatsIh9qvnNjPyq5fV+TgG8HBjUdoUSJQUmKcIGgB WH/xyDkPSo6qgGN/nkxxgT36NqVzEJS65NN4CLgj4iNMNTeb/3tKBSxKkOfgLDf6XalO /PbSisO8ox/785lUeZuXjyamlI1tnHw6OCfCm+5BPQgLWGeACJ9Yi24paOxMNiwYm4Le LpIAcZOJ6AOdM4KrjWKDtnhIe/xfX0MV+bHiuik+3J4e26UvygTaVnnZtI81RpUBSc2z aY9d2eLVLZtzFD6/RnsVoKVWZHvNGTq7eT+yKXliqZYGM8Ugb1b7v8uJ3kzmVc7ltHYV 4NrA== 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=MeP0F0l2ivVD7SK1oXYbUrrM9DEwmjD0zsNJt80fRpk=; b=BpdPSfDL4gJQFWgShMbkaa3FgM45uYGr7Kgbr2JF9h7lwQTjYuXIF2eVoI2KjfLotp y2k5AVzEvL6KAsL2HkD36ZNcDXpND9R0r9F5JDIOevsXJszSNc1YTNLmdmJ2WPmWln/Q gkqZEhF7AhduDBr3gWd4tS2grwifLfs3W35VNZotU4dmx4Qk3+fGddiTXcv31nGWV4qG rUhvVjrFtKoJAlaBuWjLD/QC2QQbWkJVyHLqBHDqRWXQAfqa6L+tndFrcRtQg99lg9zI Muz8b3MV4Feuhjqx4sQ9DaqbAJDgs8HDauSaJMJ/U6vTjxCcKoB4VT7Nms6hZhrcZ0Nc y7UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OCZu2v7v; 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 w5-20020a50d785000000b004627741e339si26958edi.113.2022.12.05.08.53.16; Mon, 05 Dec 2022 08:53:39 -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=OCZu2v7v; 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 S233265AbiLEQwX (ORCPT + 99 others); Mon, 5 Dec 2022 11:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232463AbiLEQvR (ORCPT ); Mon, 5 Dec 2022 11:51:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 859B22182B for ; Mon, 5 Dec 2022 08:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258957; 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=MeP0F0l2ivVD7SK1oXYbUrrM9DEwmjD0zsNJt80fRpk=; b=OCZu2v7vwaWJHymZ5qThqC42uMhGqSNvGNtB8xSXeeBgghfvS5ws/M+PnY/Y7HUS0kyjj+ ldUBaA1HGNKF58KIblhdOCa8Qgx5puoHtKJCD8UlksJ8M/D0c0QnTK6O3RZRoxvhhl0XUM 6aqRiHWeJgW1FDBK9xfqGNNGutIFqLc= 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-199-oeRv5yESPf66qvbMUdFfDg-1; Mon, 05 Dec 2022 11:49:12 -0500 X-MC-Unique: oeRv5yESPf66qvbMUdFfDg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9041638164C3; Mon, 5 Dec 2022 16:49:10 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED5A51410DD9; Mon, 5 Dec 2022 16:49:08 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v2 4/4] selftests: hid: ensures we have the proper requirements in config Date: Mon, 5 Dec 2022 17:48:56 +0100 Message-Id: <20221205164856.705656-5-benjamin.tissoires@redhat.com> In-Reply-To: <20221205164856.705656-1-benjamin.tissoires@redhat.com> References: <20221205164856.705656-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=unavailable 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?1751393731427267230?= X-GMAIL-MSGID: =?utf-8?q?1751393731427267230?= DYNAMIC_FTRACE_WITH_DIRECT_CALLS is implicit on x86_64 but is still a WIP on aarm64. Ensure we get it selected to not have any surprises. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/hid/config | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/hid/config b/tools/testing/selftests/hid/config index d4130489c1b1..9c5a55abca6b 100644 --- a/tools/testing/selftests/hid/config +++ b/tools/testing/selftests/hid/config @@ -11,6 +11,7 @@ CONFIG_BPF_SYSCALL=y CONFIG_BPF=y CONFIG_CGROUP_BPF=y CONFIG_DEBUG_INFO_BTF=y +CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y CONFIG_FPROBE=y CONFIG_FTRACE_SYSCALLS=y CONFIG_FUNCTION_TRACER=y