summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/kprobes.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-03-05 10:21:30 +0100
committerPeter Zijlstra <peterz@infradead.org>2020-03-20 13:06:22 +0100
commitd8a738689794c42c3844284b99ddf165d10a724e (patch)
treefe08aebdea08225ef9c23a99fb87401169261c76 /arch/x86/include/asm/kprobes.h
parentd1c9f7d117195da6229408d31d01ee011425fc68 (diff)
x86/optprobe: Fix OPTPROBE vs UACCESS
While looking at an objtool UACCESS warning, it suddenly occurred to me that it is entirely possible to have an OPTPROBE right in the middle of an UACCESS region. In this case we must of course clear FLAGS.AC while running the KPROBE. Luckily the trampoline already saves/restores [ER]FLAGS, so all we need to do is inject a CLAC. Unfortunately we cannot use ALTERNATIVE() in the trampoline text, so we have to frob that manually. Fixes: ca0bbc70f147 ("sched/x86_64: Don't save flags on context switch") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lkml.kernel.org/r/20200305092130.GU2596@hirez.programming.kicks-ass.net
Diffstat (limited to 'arch/x86/include/asm/kprobes.h')
-rw-r--r--arch/x86/include/asm/kprobes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kprobes.h b/arch/x86/include/asm/kprobes.h
index 95b1f053bd96..073eb7ad2f56 100644
--- a/arch/x86/include/asm/kprobes.h
+++ b/arch/x86/include/asm/kprobes.h
@@ -36,6 +36,7 @@ typedef u8 kprobe_opcode_t;
/* optinsn template addresses */
extern __visible kprobe_opcode_t optprobe_template_entry[];
+extern __visible kprobe_opcode_t optprobe_template_clac[];
extern __visible kprobe_opcode_t optprobe_template_val[];
extern __visible kprobe_opcode_t optprobe_template_call[];
extern __visible kprobe_opcode_t optprobe_template_end[];