diff options
author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2023-09-13 02:32:10 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-09-16 19:36:43 +0300 |
commit | 06d686f771ddc27a8554cd8f5b22e071040dc90e (patch) | |
tree | cf207fd0455d4abeaf94b3322bc782336cfd612f /tools/perf/scripts/python/mem-phys-addr.py | |
parent | fd548e1a46185000191a89cae4be560e076ed6c7 (diff) | |
download | linux-06d686f771ddc27a8554cd8f5b22e071040dc90e.tar.xz |
bpf: Fix kfunc callback register type handling
The kfunc code to handle KF_ARG_PTR_TO_CALLBACK does not check the reg
type before using reg->subprogno. This can accidently permit invalid
pointers from being passed into callback helpers (e.g. silently from
different paths). Likewise, reg->subprogno from the per-register type
union may not be meaningful either. We need to reject any other type
except PTR_TO_FUNC.
Acked-by: Dave Marchevsky <davemarchevsky@fb.com>
Fixes: 5d92ddc3de1b ("bpf: Add callback validation to kfunc verifier logic")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20230912233214.1518551-14-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions