]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: add new negative selftests to cover missing check_func_arg_reg_off() and reg...
authorMatt Bobrowski <mattbobrowski@google.com>
Tue, 25 Jun 2024 06:28:57 +0000 (06:28 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Jun 2024 20:17:32 +0000 (13:17 -0700)
commitaa293983d2020390e286544b120f3cd0a3d40749
treea62f7dab25bae1f0f0ccd09e75b75c85ff97e2e7
parentec2b9a5e11e51fea1bb04c1e7e471952e887e874
bpf: add new negative selftests to cover missing check_func_arg_reg_off() and reg->type check

Add new negative selftests which are intended to cover the
out-of-bounds memory access that could be performed on a
CONST_PTR_TO_DYNPTR within functions taking a ARG_PTR_TO_DYNPTR |
MEM_RDONLY as an argument, and acceptance of invalid register types
i.e. PTR_TO_BTF_ID within functions taking a ARG_PTR_TO_DYNPTR |
MEM_RDONLY.

Reported-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20240625062857.92760-2-mattbobrowski@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/dynptr_fail.c
tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c
tools/testing/selftests/bpf/progs/test_kfunc_param_nullable.c
tools/testing/selftests/bpf/progs/user_ringbuf_fail.c