Skip to content

Commit 13ebe18

Browse files
mhiramatKAGA-KOKO
authored andcommitted
uprobes/x86: Prohibit probing on MOV SS instruction
Since MOV SS and POP SS instructions will delay the exceptions until the next instruction is executed, single-stepping on it by uprobes must be prohibited. uprobe already rejects probing on POP SS (0x1f), but allows probing on MOV SS (0x8e and reg == 2). This checks the target instruction and if it is MOV SS or POP SS, returns -ENOTSUPP to reject probing. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Oleg Nesterov <[email protected]> Cc: Ricardo Neri <[email protected]> Cc: Francis Deslauriers <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: "H . Peter Anvin" <[email protected]> Cc: Yonghong Song <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: "David S . Miller" <[email protected]> Link: https://lkml.kernel.org/r/152587072544.17316.5950935243917346341.stgit@devbox
1 parent ee6a735 commit 13ebe18

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kernel/uprobes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
299299
if (is_prefix_bad(insn))
300300
return -ENOTSUPP;
301301

302+
/* We should not singlestep on the exception masking instructions */
303+
if (insn_masking_exception(insn))
304+
return -ENOTSUPP;
305+
302306
if (x86_64)
303307
good_insns = good_insns_64;
304308
else

0 commit comments

Comments
 (0)