diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-04 08:58:27 +0900 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-05 09:08:25 +0900 |
| commit | 6a658cc2d605e5acf35e638c62f480460d5939cd (patch) | |
| tree | 346dfcc76b5fada411ff41d8071469f75d4f3328 /include/linux | |
| parent | 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 (diff) | |
kprobes: Fix error return and slot leak in __register_kprobe()
When arm_kprobe() fails in __register_kprobe(), the probe is removed
from kprobe_table and synchronize_rcu() is executed, but the error code
ret was ignored and try_to_optimize_kprobe(p) was executed, returning 0.
Additionally, the instruction slot allocated by prepare_kprobe() was
leaked.
Fix this by releasing the instruction slot via arch_remove_kprobe(p)
and returning ret when arm_kprobe() fails.
Link: https://lore.kernel.org/all/179375030756.247640.10859474201266455798.stgit@devnote2/
Fixes: 587e8e6d640b ("kprobes: Adopt guard() and scoped_guard()")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
