]> git.baikalelectronics.ru Git - kernel.git/commit
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:17:58 +0000 (07:17 +0100)
commitc2e5bb709bacbd8cd0bdb8348afe717e3ce62bc2
tree14609851bb428e305181267bfc3e01101f5740c0
parentc34a8ecc5f1e9627e28a70b139a505e1ba0d89f5
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]