File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,19 @@ kmmio_fault(struct pt_regs *regs, unsigned long addr)
44
44
45
45
static nokprobe_inline int kprobes_fault (struct pt_regs * regs )
46
46
{
47
- int ret = 0 ;
48
-
49
- /* kprobe_running() needs smp_processor_id() */
50
- if (kprobes_built_in () && !user_mode (regs )) {
51
- preempt_disable ();
52
- if (kprobe_running () && kprobe_fault_handler (regs , 14 ))
53
- ret = 1 ;
54
- preempt_enable ();
55
- }
56
-
57
- return ret ;
47
+ if (!kprobes_built_in ())
48
+ return 0 ;
49
+ if (user_mode (regs ))
50
+ return 0 ;
51
+ /*
52
+ * To be potentially processing a kprobe fault and to be allowed to call
53
+ * kprobe_running(), we have to be non-preemptible.
54
+ */
55
+ if (preemptible ())
56
+ return 0 ;
57
+ if (!kprobe_running ())
58
+ return 0 ;
59
+ return kprobe_fault_handler (regs , X86_TRAP_PF );
58
60
}
59
61
60
62
/*
You can’t perform that action at this time.
0 commit comments