Re: [PATCH bpf-next v2 5/5] selftests/bpf: verify zext_dst annotations for various instructions
Eduard Zingerman <[email protected]> Fri, 31 Jul 2026 21:24:44 -0700
| Newsgroups | dev.linux.lists.sashiko-reviews,org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 2026-08-01 at 01:33 +0000, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issu= e(s) to consider: > - [Medium] Missing bpf_testmod dependency check in test_verifier_zext, ca= using spurious test failures when the module is not loaded. > -- >=20 > --- Patch [5]: [PATCH bpf-next v2 5/5] selftests/bpf: verify zext_dst ann= otations for various instructions --- > commit 9e656f5e6b04a69526327df6f70d8c362d02d3d4 > Author: Eduard Zingerman <[email protected]> >=20 > selftests/bpf: verify zext_dst annotations for various instructions >=20 > This commit adds a suite of selftests to verify the verifier's zero exten= sion > behavior across various instructions and state pruning scenarios. It cove= rs > cases like 32-bit and 64-bit operations, atomic instructions, kfunc param= eters, > and CFG edge cases. >=20 > > diff --git a/tools/testing/selftests/bpf/prog_tests/verifier.c b/tools/= testing/selftests/bpf/prog_tests/verifier.c > > index be97f6887f0e7..fba562c819691 100644 > > --- a/tools/testing/selftests/bpf/prog_tests/verifier.c > > +++ b/tools/testing/selftests/bpf/prog_tests/verifier.c > [ ... ] > > @@ -277,6 +278,7 @@ void test_irq(void) =C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 { RUN(irq); } > > =C2=A0void test_verifier_mtu(void) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { RU= N(verifier_mtu); } > > =C2=A0void test_verifier_jit_inline(void)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { RUN(verifier_jit_i= nline); } > > =C2=A0void test_verifier_ctx_ptr_param(void)=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 { RUN(verifier_ctx_ptr_param); } > > +void test_verifier_zext(void)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { RUN_TESTS(verif= ier_zext); } >=20 > [Severity: Medium] > Since verifier_zext.c calls bpf_kfunc_call_test4 (an extern kfunc from > bpf_testmod), will this test fail spuriously if bpf_testmod is not loaded= ? >=20 > Should this check env.has_testmod and call test__skip() before RUN_TESTS > to gracefully skip the test when the module is unavailable? Idk, bpf_kfunc_call_test4() is used by the test progs/kfunc_call_test.c prog_tests/kfunc_call.c, which itself does not check for env.has_testmod. I don't think we enforce this rigorously, nor that we should.