[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-13ebe18c94f5b0665c01ae7fad2717ae959f4212@git.kernel.org>
Date: Sun, 13 May 2018 10:58:17 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mhiramat@...nel.org, yhs@...com, torvalds@...ux-foundation.org,
bp@...e.de, luto@...nel.org, ricardo.neri-calderon@...ux.intel.com,
linux-kernel@...r.kernel.org, oleg@...hat.com, mingo@...nel.org,
francis.deslauriers@...icios.com, rostedt@...dmis.org,
ast@...nel.org, hpa@...or.com, tglx@...utronix.de,
davem@...emloft.net
Subject: [tip:x86/urgent] uprobes/x86: Prohibit probing on MOV SS
instruction
Commit-ID: 13ebe18c94f5b0665c01ae7fad2717ae959f4212
Gitweb: https://git.kernel.org/tip/13ebe18c94f5b0665c01ae7fad2717ae959f4212
Author: Masami Hiramatsu <mhiramat@...nel.org>
AuthorDate: Wed, 9 May 2018 21:58:45 +0900
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sun, 13 May 2018 19:52:56 +0200
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 <mhiramat@...nel.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Oleg Nesterov <oleg@...hat.com>
Cc: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Francis Deslauriers <francis.deslauriers@...icios.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: "H . Peter Anvin" <hpa@...or.com>
Cc: Yonghong Song <yhs@...com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "David S . Miller" <davem@...emloft.net>
Link: https://lkml.kernel.org/r/152587072544.17316.5950935243917346341.stgit@devbox
---
arch/x86/kernel/uprobes.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 85c7ef23d99f..c84bb5396958 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -299,6 +299,10 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
if (is_prefix_bad(insn))
return -ENOTSUPP;
+ /* We should not singlestep on the exception masking instructions */
+ if (insn_masking_exception(insn))
+ return -ENOTSUPP;
+
if (x86_64)
good_insns = good_insns_64;
else
Powered by blists - more mailing lists