]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Negative test case for ref_obj_id in args
authorPaul Chaignon <paul.chaignon@gmail.com>
Wed, 2 Jul 2025 13:53:23 +0000 (15:53 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 2 Jul 2025 17:43:34 +0000 (10:43 -0700)
commit7ec899ac90a205090275cd4a5c96c9606a93f3a1
treecfe3c78f4552ec5c044dc2eaae10698c844aadad
parenta90f5f7370c283863d3872f231debc9b2227b27f
selftests/bpf: Negative test case for ref_obj_id in args

This patch adds a test case, as shown below, for the verifier error
"more than one arg with ref_obj_id".

    0: (b7) r2 = 20
    1: (b7) r3 = 0
    2: (18) r1 = 0xffff92cee3cbc600
    4: (85) call bpf_ringbuf_reserve#131
    5: (55) if r0 == 0x0 goto pc+3
    6: (bf) r1 = r0
    7: (bf) r2 = r0
    8: (85) call bpf_tcp_raw_gen_syncookie_ipv4#204
    9: (95) exit

This error is currently incorrectly reported as a verifier bug, with a
warning. The next patch in this series will address that.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/3ba78e6cda47ccafd6ea70dadbc718d020154664.1751463262.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
tools/testing/selftests/bpf/verifier/calls.c