]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Add tests for rejection of ALU ops with negative offsets
authorEduard Zingerman <eddyz87@gmail.com>
Thu, 2 Oct 2025 19:11:40 +0000 (12:11 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 2 Oct 2025 20:34:08 +0000 (13:34 -0700)
commit2ce61c63e7459058709f12f43a8a98c500382382
treea9ea28b2e5038fc94c28396a1727996a67eeb6f8
parentf09f57c7467710144e7522c7fa1abca87af8f7c6
selftests/bpf: Add tests for rejection of ALU ops with negative offsets

Define a simple program using MOD, DIV, ADD instructions,
make sure that the program is rejected if invalid offset
field is used for instruction.

These are test cases for
commit 55c0ced59fe1 ("bpf: Reject negative offsets for ALU ops")
Link: https://lore.kernel.org/all/tencent_70D024BAE70A0A309A4781694C7B764B0608@qq.com/
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_value_illegal_alu.c