aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/kprobes.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index a72e02bf1135..711fec8f6379 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -44,6 +44,7 @@
44#include <linux/ptrace.h> 44#include <linux/ptrace.h>
45#include <linux/string.h> 45#include <linux/string.h>
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/hardirq.h>
47#include <linux/preempt.h> 48#include <linux/preempt.h>
48#include <linux/module.h> 49#include <linux/module.h>
49#include <linux/kdebug.h> 50#include <linux/kdebug.h>
@@ -951,12 +952,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
951 ret = NOTIFY_STOP; 952 ret = NOTIFY_STOP;
952 break; 953 break;
953 case DIE_GPF: 954 case DIE_GPF:
954 /* kprobe_running() needs smp_processor_id() */ 955 /*
955 preempt_disable(); 956 * To be potentially processing a kprobe fault and to
956 if (kprobe_running() && 957 * trust the result from kprobe_running(), we have
958 * be non-preemptible.
959 */
960 if (!preemptible() && kprobe_running() &&
957 kprobe_fault_handler(args->regs, args->trapnr)) 961 kprobe_fault_handler(args->regs, args->trapnr))
958 ret = NOTIFY_STOP; 962 ret = NOTIFY_STOP;
959 preempt_enable();
960 break; 963 break;
961 default: 964 default:
962 break; 965 break;