]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: detect non null pointer with register operand in JEQ/JNE.
authorCupertino Miranda <cupertino.miranda@oracle.com>
Wed, 4 Mar 2026 19:50:17 +0000 (19:50 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 10 Mar 2026 18:51:18 +0000 (11:51 -0700)
commit2f4cb53eed448c1aeb6f4b40cf9c810716d8218c
tree7fe8a69458989eec119bdcdb794ba2a89b8dfcdf
parentbd2e02e3c9215305dfa344c050d5822f19929cf7
bpf: detect non null pointer with register operand in JEQ/JNE.

This patch adds support to validate a pointer as not null when its
value is compared to a register whose value the verifier knows to be
null.
Initial pattern only verifies against an immediate operand.

Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
Cc: David Faust <david.faust@oracle.com>
Cc: Jose Marchesi <jose.marchesi@oracle.com>
Cc: Elena Zannoni <elena.zannoni@oracle.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260304195018.181396-3-cupertino.miranda@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c