]> git.dujemihanovic.xyz Git - linux.git/commit
bpf: check bpf_dummy_struct_ops program params for test runs
authorEduard Zingerman <eddyz87@gmail.com>
Wed, 24 Apr 2024 01:28:20 +0000 (18:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 25 Apr 2024 19:42:43 +0000 (12:42 -0700)
commit980ca8ceeae69ddf362870ea9183f389ae26324a
treeb66c8c8eacef1fd3ce9d0dd4afa3f04643706a6b
parentf612210d456a0b969a0adca91e68dbea0e0ea301
bpf: check bpf_dummy_struct_ops program params for test runs

When doing BPF_PROG_TEST_RUN for bpf_dummy_struct_ops programs,
reject execution when NULL is passed for non-nullable params.
For programs with non-nullable params verifier assumes that
such params are never NULL and thus might optimize out NULL checks.

Suggested-by: Kui-Feng Lee <sinquersw@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20240424012821.595216-5-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/bpf/bpf_dummy_struct_ops.c