selftests/bpf: Add cmp_map_pointer_with_const test
authorIhor Solodrai <isolodrai@meta.com>
Mon, 9 Jun 2025 18:30:23 +0000 (11:30 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 9 Jun 2025 23:42:04 +0000 (16:42 -0700)
commiteb6c99278490a9045662cbc2df9e2a99489df37a
tree26f0fa6dedc6b8609323f39646d6356f41ef8a59
parent5534e58f2e9bd72b253d033ee0af6e68eb8ac96b
selftests/bpf: Add cmp_map_pointer_with_const test

Add a test for CONST_PTR_TO_MAP comparison with a non-0 constant. A
BPF program with this code must not pass verification in unpriv.

Signed-off-by: Ihor Solodrai <isolodrai@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250609183024.359974-3-isolodrai@meta.com
tools/testing/selftests/bpf/progs/verifier_unpriv.c