diff options
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 734e9a7d280b..3995f546d0f3 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -1778,7 +1778,18 @@ static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs) | |||
1778 | unsigned long hash, flags = 0; | 1778 | unsigned long hash, flags = 0; |
1779 | struct kretprobe_instance *ri; | 1779 | struct kretprobe_instance *ri; |
1780 | 1780 | ||
1781 | /*TODO: consider to only swap the RA after the last pre_handler fired */ | 1781 | /* |
1782 | * To avoid deadlocks, prohibit return probing in NMI contexts, | ||
1783 | * just skip the probe and increase the (inexact) 'nmissed' | ||
1784 | * statistical counter, so that the user is informed that | ||
1785 | * something happened: | ||
1786 | */ | ||
1787 | if (unlikely(in_nmi())) { | ||
1788 | rp->nmissed++; | ||
1789 | return 0; | ||
1790 | } | ||
1791 | |||
1792 | /* TODO: consider to only swap the RA after the last pre_handler fired */ | ||
1782 | hash = hash_ptr(current, KPROBE_HASH_BITS); | 1793 | hash = hash_ptr(current, KPROBE_HASH_BITS); |
1783 | raw_spin_lock_irqsave(&rp->lock, flags); | 1794 | raw_spin_lock_irqsave(&rp->lock, flags); |
1784 | if (!hlist_empty(&rp->free_instances)) { | 1795 | if (!hlist_empty(&rp->free_instances)) { |