File tree 1 file changed +9
-8
lines changed 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -61,26 +61,27 @@ static inline void no_context(struct pt_regs *regs, unsigned long addr)
61
61
62
62
static inline void mm_fault_error (struct pt_regs * regs , unsigned long addr , vm_fault_t fault )
63
63
{
64
+ if (!user_mode (regs )) {
65
+ no_context (regs , addr );
66
+ return ;
67
+ }
68
+
64
69
if (fault & VM_FAULT_OOM ) {
65
70
/*
66
71
* We ran out of memory, call the OOM killer, and return the userspace
67
72
* (which will retry the fault, or kill us if we got oom-killed).
68
73
*/
69
- if (!user_mode (regs )) {
70
- no_context (regs , addr );
71
- return ;
72
- }
73
74
pagefault_out_of_memory ();
74
75
return ;
75
76
} else if (fault & (VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE )) {
76
77
/* Kernel mode? Handle exceptions or die */
77
- if (!user_mode (regs )) {
78
- no_context (regs , addr );
79
- return ;
80
- }
81
78
do_trap (regs , SIGBUS , BUS_ADRERR , addr );
82
79
return ;
80
+ } else if (fault & VM_FAULT_SIGSEGV ) {
81
+ do_trap (regs , SIGSEGV , SEGV_MAPERR , addr );
82
+ return ;
83
83
}
84
+
84
85
BUG ();
85
86
}
86
87
You can’t perform that action at this time.
0 commit comments