selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID
authorHao Sun <sunhao.th@gmail.com>
Thu, 22 Dec 2022 02:44:14 +0000 (10:44 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 23 Dec 2022 01:19:23 +0000 (17:19 -0800)
commitcedebd74cf3883f0384af9ec26b4e6f8f1964dd4
treed54ac901bb6743480c5bbf351a317975e5a1799b
parent8374bfd5a3c90a5b250f7c087c4d2b8ac467b12e
selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID

Verify that nullness information is not porpagated in the branches
of register to register JEQ and JNE operations if one of them is
PTR_TO_BTF_ID. Implement this in C level so we can use CO-RE.

Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20221222024414.29539-2-sunhao.th@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/jeq_infer_not_null.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/jeq_infer_not_null_fail.c [new file with mode: 0644]