Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kprobes: Fix KRETPROBES when CONFIG_KRETPROBE_ON_RETHOOK is set
The recent kernel change in 73f9b91 ("kprobes: Use rethook for kretprobe if possible"), introduced a potential NULL pointer dereference bug in the KRETPROBE mechanism. The official Kprobes documentation defines that "Any or all handlers can be NULL". Unfortunately, there is a missing return handler verification to fulfill these requirements and can result in a NULL pointer dereference bug. This patch adds such verification in kretprobe_rethook_handler() function. Fixes: 73f9b91 ("kprobes: Use rethook for kretprobe if possible") Signed-off-by: Adam Zabrocki <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Naveen N. Rao <[email protected]> Cc: Anil S. Keshavamurthy <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
- Loading branch information