aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-06-25 09:49:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-25 09:49:32 -0400
commit9a949a98596c45763299158b9018f3491e3cbf99 (patch)
treefd7943339a39997d2906f1951ee2565e175be3c7
parent57801c1b817128cbb3a4dc45e6a1e0e31a227a19 (diff)
parentdcfc47248d3f7d28df6f531e6426b933de94370d (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 kprobe fix from Thomas Gleixner: "A single fix clearing the TF bit when a fault is single stepped" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: kprobes/x86: Clear TF bit in fault on single-stepping
-rw-r--r--arch/x86/kernel/kprobes/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 38cf7a741250..7847e5c0e0b5 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -961,7 +961,19 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
961 * normal page fault. 961 * normal page fault.
962 */ 962 */
963 regs->ip = (unsigned long)cur->addr; 963 regs->ip = (unsigned long)cur->addr;
964 /*
965 * Trap flag (TF) has been set here because this fault
966 * happened where the single stepping will be done.
967 * So clear it by resetting the current kprobe:
968 */
969 regs->flags &= ~X86_EFLAGS_TF;
970
971 /*
972 * If the TF flag was set before the kprobe hit,
973 * don't touch it:
974 */
964 regs->flags |= kcb->kprobe_old_flags; 975 regs->flags |= kcb->kprobe_old_flags;
976
965 if (kcb->kprobe_status == KPROBE_REENTER) 977 if (kcb->kprobe_status == KPROBE_REENTER)
966 restore_previous_kprobe(kcb); 978 restore_previous_kprobe(kcb);
967 else 979 else