summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/kprobes/core.c
diff options
context:
space:
mode:
authorChen Zhongjin <chenzhongjin@huawei.com>2022-08-01 11:37:19 +0800
committerIngo Molnar <mingo@kernel.org>2022-08-02 11:47:29 +0200
commit28f6c37a2910f565b4f5960df52b2eccae28c891 (patch)
tree5d8aea752d27e43075fb186acf1651cfa18d7c9f /arch/x86/kernel/kprobes/core.c
parent9de1f9c8ca5100a02a2e271bdbde36202e251b4b (diff)
downloadlinux-28f6c37a2910f565b4f5960df52b2eccae28c891.tar.bz2
kprobes: Forbid probing on trampoline and BPF code areas
kernel_text_address() treats ftrace_trampoline, kprobe_insn_slot and bpf_text_address as valid kprobe addresses - which is not ideal. These text areas are removable and changeable without any notification to kprobes, and probing on them can trigger unexpected behavior: https://lkml.org/lkml/2022/7/26/1148 Considering that jump_label and static_call text are already forbiden to probe, kernel_text_address() should be replaced with core_kernel_text() and is_module_text_address() to check other text areas which are unsafe to kprobe. [ mingo: Rewrote the changelog. ] Fixes: 5b485629ba0d ("kprobes, extable: Identify kprobes trampolines as kernel text area") Fixes: 74451e66d516 ("bpf: make jited programs visible in traces") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20220801033719.228248-1-chenzhongjin@huawei.com
Diffstat (limited to 'arch/x86/kernel/kprobes/core.c')
0 files changed, 0 insertions, 0 deletions