diff options
| -rw-r--r-- | arch/x86/kernel/kprobes_32.c | 7 | ||||
| -rw-r--r-- | arch/x86/kernel/kprobes_64.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c index c2d03e96ae9f..e7d0d3c2ef64 100644 --- a/arch/x86/kernel/kprobes_32.c +++ b/arch/x86/kernel/kprobes_32.c | |||
| @@ -557,6 +557,12 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) | |||
| 557 | 557 | ||
| 558 | resume_execution(cur, regs, kcb); | 558 | resume_execution(cur, regs, kcb); |
| 559 | regs->eflags |= kcb->kprobe_saved_eflags; | 559 | regs->eflags |= kcb->kprobe_saved_eflags; |
| 560 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | ||
| 561 | if (raw_irqs_disabled_flags(regs->eflags)) | ||
| 562 | trace_hardirqs_off(); | ||
| 563 | else | ||
| 564 | trace_hardirqs_on(); | ||
| 565 | #endif | ||
| 560 | 566 | ||
| 561 | /*Restore back the original saved kprobes variables and continue. */ | 567 | /*Restore back the original saved kprobes variables and continue. */ |
| 562 | if (kcb->kprobe_status == KPROBE_REENTER) { | 568 | if (kcb->kprobe_status == KPROBE_REENTER) { |
| @@ -694,6 +700,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 694 | memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, | 700 | memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, |
| 695 | MIN_STACK_SIZE(addr)); | 701 | MIN_STACK_SIZE(addr)); |
| 696 | regs->eflags &= ~IF_MASK; | 702 | regs->eflags &= ~IF_MASK; |
| 703 | trace_hardirqs_off(); | ||
| 697 | regs->eip = (unsigned long)(jp->entry); | 704 | regs->eip = (unsigned long)(jp->entry); |
| 698 | return 1; | 705 | return 1; |
| 699 | } | 706 | } |
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c index 1df17a0ec0c9..62e28e52d784 100644 --- a/arch/x86/kernel/kprobes_64.c +++ b/arch/x86/kernel/kprobes_64.c | |||
| @@ -544,6 +544,12 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs) | |||
| 544 | 544 | ||
| 545 | resume_execution(cur, regs, kcb); | 545 | resume_execution(cur, regs, kcb); |
| 546 | regs->eflags |= kcb->kprobe_saved_rflags; | 546 | regs->eflags |= kcb->kprobe_saved_rflags; |
| 547 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | ||
| 548 | if (raw_irqs_disabled_flags(regs->eflags)) | ||
| 549 | trace_hardirqs_off(); | ||
| 550 | else | ||
| 551 | trace_hardirqs_on(); | ||
| 552 | #endif | ||
| 547 | 553 | ||
| 548 | /* Restore the original saved kprobes variables and continue. */ | 554 | /* Restore the original saved kprobes variables and continue. */ |
| 549 | if (kcb->kprobe_status == KPROBE_REENTER) { | 555 | if (kcb->kprobe_status == KPROBE_REENTER) { |
| @@ -684,6 +690,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 684 | memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, | 690 | memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, |
| 685 | MIN_STACK_SIZE(addr)); | 691 | MIN_STACK_SIZE(addr)); |
| 686 | regs->eflags &= ~IF_MASK; | 692 | regs->eflags &= ~IF_MASK; |
| 693 | trace_hardirqs_off(); | ||
| 687 | regs->rip = (unsigned long)(jp->entry); | 694 | regs->rip = (unsigned long)(jp->entry); |
| 688 | return 1; | 695 | return 1; |
| 689 | } | 696 | } |
