From: sashiko-bot@kernel.org
To: "Leon Hwang" <leon.hwang@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 2/2] selftests/bpf: Verify rejection of sleepable tracing prog
Date: Tue, 04 Aug 2026 15:49:52 +0000 [thread overview]
Message-ID: <20260804154953.394411F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260804145710.43062-3-leon.hwang@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The test contains dead reproducer code that intentionally crashes the kernel on test failure instead of failing gracefully.
--
--- Patch [2]: [PATCH bpf-next v3 2/2] selftests/bpf: Verify rejection of sleepable tracing prog ---
commit 22c464db2aa39d78b7ca52b202c4a7828b6fddc2
Author: Leon Hwang <leon.hwang@linux.dev>
selftests/bpf: Verify rejection of sleepable tracing prog
This commit adds a test to verify that a sleepable tracing program cannot
attach to a '__x64_sys' prefixed program target.
> diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> index 4a87d7163c8c7..2523c07a16c65 100644
> --- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> +++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
[ ... ]
> @@ -576,6 +577,60 @@ static void test_func_replace_progmap(void)
> freplace_progmap__destroy(skel);
> }
>
> +static void test_sleepable_fentry_to_xdp(void)
> +{
[ ... ]
> + err = fentry_sleepable__load(skel);
> + ASSERT_ERR(err, "fentry_sleepable__load");
> + if (err)
> + goto out;
> +
> + skel->links.fentry_xdp = bpf_program__attach_trace(skel->progs.fentry_xdp);
> + if (!ASSERT_OK_PTR(skel->links.fentry_xdp, "bpf_program__attach_trace"))
> + goto out;
> +
> + skel_xdp->links.__x64_sys_nop = bpf_program__attach_xdp(skel_xdp->progs.__x64_sys_nop,
> + ifindex);
> + if (!ASSERT_OK_PTR(skel_xdp->links.__x64_sys_nop, "bpf_program__attach_xdp"))
> + goto out;
> +
> + err = system("ping -q -c 1 -W 1 127.0.0.1 > /dev/null");
> + ASSERT_OK(err, "ping");
> + ASSERT_ERR(skel->bss->retval, "retval");
[Severity: Medium]
Will this sequence crash the kernel if the test fails?
If the kernel lacks the fix, fentry_sleepable__load() will return 0.
ASSERT_ERR() will correctly log a test failure, but since err == 0, the
if (err) goto out; check will be bypassed.
The test will then proceed to attach the sleepable program and trigger it
with ping, intentionally causing the kernel panic described in the commit
message.
Additionally, when the kernel is fixed and the test passes, this entire block
is dead code because fentry_sleepable__load() returns < 0 and the test exits
early via goto out.
Could this test fail gracefully without crashing the system during automated
bisections?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260804145710.43062-1-leon.hwang@linux.dev?part=2
prev parent reply other threads:[~2026-08-04 15:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 14:57 [PATCH bpf-next v3 0/2] bpf: Fix sleepable check for tracing prog Leon Hwang
2026-08-04 14:57 ` [PATCH bpf-next v3 1/2] " Leon Hwang
2026-08-04 15:43 ` sashiko-bot
2026-08-04 23:39 ` Andrii Nakryiko
[not found] ` <20260804145710.43062-3-leon.hwang@linux.dev>
2026-08-04 15:49 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804154953.394411F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=leon.hwang@linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox