linux-stable/arch/x86/kernel/kprobes
Masami Hiramatsu (Google) b69f577308 kprobes/x86: Use copy_from_kernel_nofault() to read from unsafe address
[ Upstream commit 4e51653d5d ]

Read from an unsafe address with copy_from_kernel_nofault() in
arch_adjust_kprobe_addr() because this function is used before checking
the address is in text or not. Syzcaller bot found a bug and reported
the case if user specifies inaccessible data area,
arch_adjust_kprobe_addr() will cause a kernel panic.

[ mingo: Clarified the comment. ]

Fixes: cc66bb9145 ("x86/ibt,kprobes: Cure sym+0 equals fentry woes")
Reported-by: Qiang Zhang <zzqq0103.hey@gmail.com>
Tested-by: Jinghao Jia <jinghao7@illinois.edu>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/171042945004.154897.2221804961882915806.stgit@devnote2
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:34 +02:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
common.h x86,rethook,kprobes: Replace kretprobe with rethook on x86 2022-03-28 19:38:51 -07:00
core.c kprobes/x86: Use copy_from_kernel_nofault() to read from unsafe address 2024-04-03 15:32:34 +02:00
ftrace.c ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
opt.c x86/retpoline,kprobes: Skip optprobe check for indirect jumps with retpolines and IBT 2023-08-14 11:46:51 +02:00