The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid
@ 2026-07-13  6:35 Shung-Hsi Yu
  2026-07-13 11:11 ` sun jian
  2026-07-13 20:47 ` Eduard Zingerman
  0 siblings, 2 replies; 5+ messages in thread
From: Shung-Hsi Yu @ 2026-07-13  6:35 UTC (permalink / raw)
  To: bpf
  Cc: Shung-Hsi Yu, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
	Emil Tsalapatis, Shuah Khan, linux-kselftest, linux-kernel,
	sun jian, Matt Mullins, stable


The raw_tp_writable_reject_nbd_invalid test relies on availability of the
nbd_send_request tracepoint, which is only present if the selftest kernel is
built with CONFIG_BLK_DEV_NBD=y and the kernel built from current BPF selftests
config lacks.

Without it, the bpf_raw_tracepoint_open() call always returns with -2, leaving
raw_tp_writable_reject_nbd_invalid test always passing without exercising the
checks bpf_probe_register().

Cc: <stable@vger.kernel.org> # 5.2.0
Link: https://lore.kernel.org/bpf/alRtilWhKw4zzMkI@u94a
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
Not sure if fixes tag is the right thing to use here, so use the cc
stable tag instead to get this config change propogated to other stable
branches to make stable BPF CI's job easier.
---
 tools/testing/selftests/bpf/config | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index adb25146e88c..e1797bd87904 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -1,4 +1,5 @@
 CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_NBD=y
 CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1
 CONFIG_BPF=y
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid
  2026-07-13  6:35 [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid Shung-Hsi Yu
@ 2026-07-13 11:11 ` sun jian
  2026-07-13 20:47 ` Eduard Zingerman
  1 sibling, 0 replies; 5+ messages in thread
From: sun jian @ 2026-07-13 11:11 UTC (permalink / raw)
  To: Shung-Hsi Yu
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
	Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
	linux-kselftest, linux-kernel, Matt Mullins, stable

On Mon, Jul 13, 2026 at 2:35 PM Shung-Hsi Yu <shung-hsi.yu@suse.com> wrote:
>
>
> The raw_tp_writable_reject_nbd_invalid test relies on availability of the
> nbd_send_request tracepoint, which is only present if the selftest kernel is
> built with CONFIG_BLK_DEV_NBD=y and the kernel built from current BPF selftests
> config lacks.
>
> Without it, the bpf_raw_tracepoint_open() call always returns with -2, leaving
> raw_tp_writable_reject_nbd_invalid test always passing without exercising the
> checks bpf_probe_register().
>
> Cc: <stable@vger.kernel.org> # 5.2.0
> Link: https://lore.kernel.org/bpf/alRtilWhKw4zzMkI@u94a
> Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
> ---
> Not sure if fixes tag is the right thing to use here, so use the cc
> stable tag instead to get this config change propogated to other stable
> branches to make stable BPF CI's job easier.
> ---
>  tools/testing/selftests/bpf/config | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
> index adb25146e88c..e1797bd87904 100644
> --- a/tools/testing/selftests/bpf/config
> +++ b/tools/testing/selftests/bpf/config
> @@ -1,4 +1,5 @@
>  CONFIG_BLK_DEV_LOOP=y
> +CONFIG_BLK_DEV_NBD=y
>  CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
>  CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1
>  CONFIG_BPF=y
> --
> 2.54.0
>

I tested this on bpf/master at 7cbd0c4cebe4. With the patch
applied, CONFIG_BLK_DEV_NBD=y and the nbd_send_request
tracepoint was present. raw_tp_writable_reject_nbd_invalid
passed, and strace showed BPF_RAW_TRACEPOINT_OPEN failing
with EINVAL rather than ENOENT.

Tested-by: Sun Jian <sun.jian.kdev@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid
  2026-07-13  6:35 [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid Shung-Hsi Yu
  2026-07-13 11:11 ` sun jian
@ 2026-07-13 20:47 ` Eduard Zingerman
  2026-07-14  3:32   ` Shung-Hsi Yu
  1 sibling, 1 reply; 5+ messages in thread
From: Eduard Zingerman @ 2026-07-13 20:47 UTC (permalink / raw)
  To: Shung-Hsi Yu, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Kumar Kartikeya Dwivedi, Martin KaFai Lau, Song Liu,
	Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
	linux-kselftest, linux-kernel, sun jian, Matt Mullins, stable

On Mon, 2026-07-13 at 14:35 +0800, Shung-Hsi Yu wrote:
> 
> The raw_tp_writable_reject_nbd_invalid test relies on availability of the
> nbd_send_request tracepoint, which is only present if the selftest kernel is
> built with CONFIG_BLK_DEV_NBD=y and the kernel built from current BPF selftests
> config lacks.
> 
> Without it, the bpf_raw_tracepoint_open() call always returns with -2, leaving
> raw_tp_writable_reject_nbd_invalid test always passing without exercising the
> checks bpf_probe_register().
> 
> Cc: <stable@vger.kernel.org> # 5.2.0
> Link: https://lore.kernel.org/bpf/alRtilWhKw4zzMkI@u94a
> Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
> ---
> Not sure if fixes tag is the right thing to use here, so use the cc
> stable tag instead to get this config change propogated to other stable
> branches to make stable BPF CI's job easier.

Shung-Hsi,

Thank you for figuring this out.
I'd suggest we switch to bpf_testmod_test_writable_bare_tp() [1]
from the test module to avoid the config dependency and let
Sun pack all of this as a single patch-set to simplify backports
(if such are necessary). Wdyt?

[1] https://lore.kernel.org/bpf/3430dc0a2a141769a596ab21d7abdd86a0a804db.camel@gmail.com/2-tp-test.diff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid
  2026-07-13 20:47 ` Eduard Zingerman
@ 2026-07-14  3:32   ` Shung-Hsi Yu
  2026-07-14  6:38     ` sun jian
  0 siblings, 1 reply; 5+ messages in thread
From: Shung-Hsi Yu @ 2026-07-14  3:32 UTC (permalink / raw)
  To: Eduard Zingerman, sun jian
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Kumar Kartikeya Dwivedi, Martin KaFai Lau, Song Liu,
	Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
	linux-kselftest, linux-kernel, Matt Mullins, stable

On Mon, Jul 13, 2026 at 01:47:18PM -0700, Eduard Zingerman wrote:
> On Mon, 2026-07-13 at 14:35 +0800, Shung-Hsi Yu wrote:
> > The raw_tp_writable_reject_nbd_invalid test relies on availability of the
> > nbd_send_request tracepoint, which is only present if the selftest kernel is
> > built with CONFIG_BLK_DEV_NBD=y and the kernel built from current BPF selftests
> > config lacks.
> > 
> > Without it, the bpf_raw_tracepoint_open() call always returns with -2, leaving
> > raw_tp_writable_reject_nbd_invalid test always passing without exercising the
> > checks bpf_probe_register().
> > 
> > Cc: <stable@vger.kernel.org> # 5.2.0
> > Link: https://lore.kernel.org/bpf/alRtilWhKw4zzMkI@u94a
> > Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
> > ---
> > Not sure if fixes tag is the right thing to use here, so use the cc
> > stable tag instead to get this config change propogated to other stable
> > branches to make stable BPF CI's job easier.
> 
> Shung-Hsi,
> 
> Thank you for figuring this out.
> I'd suggest we switch to bpf_testmod_test_writable_bare_tp() [1]
> from the test module to avoid the config dependency and let
> Sun pack all of this as a single patch-set to simplify backports
> (if such are necessary). Wdyt?

Make sense, that's probably for the better.

pw-bot: changes-requested

@Sun can you make sure to include the follow tag for [1] when you send
it? Should give a better guarantee that is will be picked up by AUTOSEL.
Thanks!

  Cc: <stable@vger.kernel.org> # 5.2.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid
  2026-07-14  3:32   ` Shung-Hsi Yu
@ 2026-07-14  6:38     ` sun jian
  0 siblings, 0 replies; 5+ messages in thread
From: sun jian @ 2026-07-14  6:38 UTC (permalink / raw)
  To: Shung-Hsi Yu
  Cc: Eduard Zingerman, bpf, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
	Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
	linux-kselftest, linux-kernel, Matt Mullins, stable

On Tue, Jul 14, 2026 at 11:32 AM Shung-Hsi Yu <shung-hsi.yu@suse.com> wrote:
>
> On Mon, Jul 13, 2026 at 01:47:18PM -0700, Eduard Zingerman wrote:
> > On Mon, 2026-07-13 at 14:35 +0800, Shung-Hsi Yu wrote:
> > > The raw_tp_writable_reject_nbd_invalid test relies on availability of the
> > > nbd_send_request tracepoint, which is only present if the selftest kernel is
> > > built with CONFIG_BLK_DEV_NBD=y and the kernel built from current BPF selftests
> > > config lacks.
> > >
> > > Without it, the bpf_raw_tracepoint_open() call always returns with -2, leaving
> > > raw_tp_writable_reject_nbd_invalid test always passing without exercising the
> > > checks bpf_probe_register().
> > >
> > > Cc: <stable@vger.kernel.org> # 5.2.0
> > > Link: https://lore.kernel.org/bpf/alRtilWhKw4zzMkI@u94a
> > > Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
> > > ---
> > > Not sure if fixes tag is the right thing to use here, so use the cc
> > > stable tag instead to get this config change propogated to other stable
> > > branches to make stable BPF CI's job easier.
> >
> > Shung-Hsi,
> >
> > Thank you for figuring this out.
> > I'd suggest we switch to bpf_testmod_test_writable_bare_tp() [1]
> > from the test module to avoid the config dependency and let
> > Sun pack all of this as a single patch-set to simplify backports
> > (if such are necessary). Wdyt?
>
> Make sense, that's probably for the better.
>

Hi Shung-Hsi and Eduard,

Thanks for tracking down the CONFIG_BLK_DEV_NBD false
pass and for the test-module suggestion.

I'll fold everything into the v5 series:

1. Keep only the necessary effective-start check in the verifier fix,
dropping the BPF_MAX_VAR_OFF and size < 0 checks as Eduard suggested.
2. Move the attach tests to bpf_testmod_test_writable_bare_tp(), use
subtests, and remove the NBD configuration dependency.
3. Add the PTR_TO_BUF negative-offset verifier case requested by Eduard.

> pw-bot: changes-requested
>
> @Sun can you make sure to include the follow tag for [1] when you send
> it? Should give a better guarantee that is will be picked up by AUTOSEL.
> Thanks!
>
>   Cc: <stable@vger.kernel.org> # 5.2.0

Will do.

Best Regards,
Sun Jian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-14  6:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13  6:35 [PATCH bpf 1/1] selftests/bpf: Enable BLK_DEV_NBD for raw_tp_writable_reject_nbd_invalid Shung-Hsi Yu
2026-07-13 11:11 ` sun jian
2026-07-13 20:47 ` Eduard Zingerman
2026-07-14  3:32   ` Shung-Hsi Yu
2026-07-14  6:38     ` sun jian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox