summaryrefslogtreecommitdiff
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-09-22 10:26:57 +0200
committerEric W. Biederman <ebiederm@xmission.com>2018-09-27 21:54:43 +0200
commitfeca355b3d8eba3a2cbca63c97a59a14681983f7 (patch)
tree4c60ae9d111db5870f794d8de3d6640deaaae944 /arch/arm64/mm
parent559d8d91a89cc2a0190781a5b5ce3faeaef7920f (diff)
signal/arm64: Add and use arm64_force_sig_fault where appropriate
Wrap force_sig_fault with a helper that calls arm64_show_signal and call arm64_force_sig_fault where appropraite. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/fault.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 959c4a565c8e..66c295019a9a 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -362,15 +362,10 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
*/
if (user_mode(regs)) {
const struct fault_info *inf = esr_to_fault_info(esr);
- struct siginfo si;
-
- clear_siginfo(&si);
- si.si_signo = inf->sig;
- si.si_code = inf->code;
- si.si_addr = (void __user *)addr;
set_thread_esr(addr, esr);
- arm64_force_sig_info(&si, inf->name);
+ arm64_force_sig_fault(inf->sig, inf->code, (void __user *)addr,
+ inf->name);
} else {
__do_kernel_fault(addr, esr, regs);
}
@@ -570,11 +565,8 @@ retry:
* We had some memory, but were unable to successfully fix up
* this page fault.
*/
- clear_siginfo(&si);
- si.si_signo = SIGBUS;
- si.si_code = BUS_ADRERR;
- si.si_addr = (void __user *)addr;
- arm64_force_sig_info(&si, inf->name);
+ arm64_force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)addr,
+ inf->name);
} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
unsigned int lsb;
@@ -593,12 +585,10 @@ retry:
* Something tried to access memory that isn't in our memory
* map.
*/
- clear_siginfo(&si);
- si.si_signo = SIGSEGV;
- si.si_code = fault == VM_FAULT_BADACCESS ?
- SEGV_ACCERR : SEGV_MAPERR;
- si.si_addr = (void __user *)addr;
- arm64_force_sig_info(&si, inf->name);
+ arm64_force_sig_fault(SIGSEGV,
+ fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR,
+ (void __user *)addr,
+ inf->name);
}
return 0;