aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/mm/fault.c')
-rw-r--r--arch/s390/mm/fault.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 5bddbe4895d5..6c013f544146 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -220,7 +220,7 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
220 case VM_FAULT_BADACCESS: 220 case VM_FAULT_BADACCESS:
221 case VM_FAULT_BADMAP: 221 case VM_FAULT_BADMAP:
222 /* Bad memory access. Check if it is kernel or user space. */ 222 /* Bad memory access. Check if it is kernel or user space. */
223 if (regs->psw.mask & PSW_MASK_PSTATE) { 223 if (user_mode(regs)) {
224 /* User mode accesses just cause a SIGSEGV */ 224 /* User mode accesses just cause a SIGSEGV */
225 si_code = (fault == VM_FAULT_BADMAP) ? 225 si_code = (fault == VM_FAULT_BADMAP) ?
226 SEGV_MAPERR : SEGV_ACCERR; 226 SEGV_MAPERR : SEGV_ACCERR;
@@ -236,13 +236,13 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
236 break; 236 break;
237 default: /* fault & VM_FAULT_ERROR */ 237 default: /* fault & VM_FAULT_ERROR */
238 if (fault & VM_FAULT_OOM) { 238 if (fault & VM_FAULT_OOM) {
239 if (!(regs->psw.mask & PSW_MASK_PSTATE)) 239 if (!user_mode(regs))
240 do_no_context(regs); 240 do_no_context(regs);
241 else 241 else
242 pagefault_out_of_memory(); 242 pagefault_out_of_memory();
243 } else if (fault & VM_FAULT_SIGBUS) { 243 } else if (fault & VM_FAULT_SIGBUS) {
244 /* Kernel mode? Handle exceptions or die */ 244 /* Kernel mode? Handle exceptions or die */
245 if (!(regs->psw.mask & PSW_MASK_PSTATE)) 245 if (!user_mode(regs))
246 do_no_context(regs); 246 do_no_context(regs);
247 else 247 else
248 do_sigbus(regs); 248 do_sigbus(regs);
@@ -436,7 +436,7 @@ void __kprobes do_asce_exception(struct pt_regs *regs)
436 } 436 }
437 437
438 /* User mode accesses just cause a SIGSEGV */ 438 /* User mode accesses just cause a SIGSEGV */
439 if (regs->psw.mask & PSW_MASK_PSTATE) { 439 if (user_mode(regs)) {
440 do_sigsegv(regs, SEGV_MAPERR); 440 do_sigsegv(regs, SEGV_MAPERR);
441 return; 441 return;
442 } 442 }