aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/kprobes.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index ecee3d23fef8..e0fb615ba1e9 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -482,22 +482,16 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
482 kcb->kprobe_status = KPROBE_REENTER; 482 kcb->kprobe_status = KPROBE_REENTER;
483 break; 483 break;
484 case KPROBE_HIT_SS: 484 case KPROBE_HIT_SS:
485 if (p == kprobe_running()) { 485 /* A probe has been hit in the codepath leading up to, or just
486 regs->flags &= ~X86_EFLAGS_TF; 486 * after, single-stepping of a probed instruction. This entire
487 regs->flags |= kcb->kprobe_saved_flags; 487 * codepath should strictly reside in .kprobes.text section.
488 return 0; 488 * Raise a BUG or we'll continue in an endless reentering loop
489 } else { 489 * and eventually a stack overflow.
490 /* A probe has been hit in the codepath leading up 490 */
491 * to, or just after, single-stepping of a probed 491 printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
492 * instruction. This entire codepath should strictly 492 p->addr);
493 * reside in .kprobes.text section. 493 dump_kprobe(p);
494 * Raise a BUG or we'll continue in an endless 494 BUG();
495 * reentering loop and eventually a stack overflow.
496 */
497 arch_disarm_kprobe(p);
498 dump_kprobe(p);
499 BUG();
500 }
501 default: 495 default:
502 /* impossible cases */ 496 /* impossible cases */
503 WARN_ON(1); 497 WARN_ON(1);