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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:22:41 +0000 (07:22 +0100)
commit95fc28a8e92169cff4b649ae9f4a209a783f2c91
tree1d35315a57b0ddadbb2b4551efb811565cd673de
parentd4a9d2944f2e83e48168c4c32ee364a81c1e5010
selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID

[ Upstream commit cedebd74cf3883f0384af9ec26b4e6f8f1964dd4 ]

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>
Signed-off-by: Sasha Levin <sashal@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]