platform_kernel-5.15/tools/testing
Kumar Kartikeya Dwivedi ccf74d1eca UPSTREAM: selftests/bpf: Add test for reg2btf_ids out of bounds access
commit 13c6a37d409db9abc9c0bfc6d0a2f07bf0fff60e upstream.

This test tries to pass a PTR_TO_BTF_ID_OR_NULL to the release function,
which would trigger a out of bounds access without the fix in commit
45ce4b4f9009 ("bpf: Fix crash due to out of bounds access into reg2btf_ids.")
but after the fix, it should only index using base_type(reg->type),
which should be less than __BPF_REG_TYPE_MAX, and also not permit any
type flags to be set for the reg->type.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220220023138.2224652-1-memxor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f59e6886ca)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia75c39dc8b826f7e55c326eeb906e2dd9f353ab9
2022-06-18 18:28:45 +00:00
..
fault-injection
ktest bootconfig/tracing/ktest: Update ktest example for boot-time tracing 2021-08-16 11:39:51 -04:00
kunit kunit: tool: Import missing importlib.abc 2022-02-23 12:03:04 +01:00
nvdimm tools/testing/nvdimm: Fix missing 'fallthrough' warning 2021-08-11 11:55:54 -07:00
radix-tree
scatterlist Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
selftests UPSTREAM: selftests/bpf: Add test for reg2btf_ids out of bounds access 2022-06-18 18:28:45 +00:00
vsock vsock_diag_test: remove free_sock_stat() call in test_no_sockets 2021-10-15 17:21:34 -07:00