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:24:30 +0000 (07:24 +0100)
commit2e5d5c4ae77dedc7eba0e496474ab93f05b25adf
treedbdbced116b9f49f569bb04625a69ac07c89110f
parent16e7fb3cc305272a26d2af19a72767f67fca5d7f
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]