aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/kprobes/core.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-07-21 13:58:19 +0800
committerAlex Shi <alex.shi@linaro.org>2016-07-21 13:58:19 +0800
commit74b60e9f6f938d0cd4c7a71e583aee3cc6c5fbba (patch)
tree15cbca70f3f6d7e10da7d82154a78e6ca35dca8c /arch/x86/kernel/kprobes/core.c
parentf24f1475658431d60bcd4e6e5de951ba1663dd43 (diff)
parent1d508e233d21a7848cf54d7d03b40dac2d9ea873 (diff)
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-rtlsk-v4.1-16.07-rt
Conflicts: mm/swap.c
Diffstat (limited to 'arch/x86/kernel/kprobes/core.c')
-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 1deffe6cc873..023c442c33bb 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -959,7 +959,19 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
* normal page fault.
*/
regs->ip = (unsigned long)cur->addr;
+ /*
+ * Trap flag (TF) has been set here because this fault
+ * happened where the single stepping will be done.
+ * So clear it by resetting the current kprobe:
+ */
+ regs->flags &= ~X86_EFLAGS_TF;
+
+ /*
+ * If the TF flag was set before the kprobe hit,
+ * don't touch it:
+ */
regs->flags |= kcb->kprobe_old_flags;
+
if (kcb->kprobe_status == KPROBE_REENTER)
restore_previous_kprobe(kcb);
else