Skip to content
Commit e884edbb authored by Jinghao Jia's avatar Jinghao Jia Committed by Masami Hiramatsu (Google)
Browse files

x86/kprobes: Prohibit kprobing on INT and UD



Both INT (INT n, INT1, INT3, INTO) and UD (UD0, UD1, UD2) serve special
purposes in the kernel, e.g., INT3 is used by KGDB and UD2 is involved
in LLVM-KCFI instrumentation. At the same time, attaching kprobes on
these instructions (particularly UD) will pollute the stack trace dumped
in the kernel ring buffer, since the exception is triggered in the copy
buffer rather than the original location.

Check for INT and UD in can_probe and reject any kprobes trying to
attach to these instructions.

Link: https://lore.kernel.org/all/20240204031300.830475-3-jinghao7@illinois.edu/

Suggested-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarJinghao Jia <jinghao7@illinois.edu>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
parent e4778a0e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment