diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-04-16 20:25:24 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-09-27 21:55:30 +0200 |
commit | 05e792e30ed039b5d202d31b86ba0d0491cd6f3c (patch) | |
tree | 2187f2391cda91ebc336cccd967da557a909b4b6 /arch/arm/kernel/swp_emulate.c | |
parent | signal/arm64: Use send_sig_fault where appropriate (diff) | |
download | linux-05e792e30ed039b5d202d31b86ba0d0491cd6f3c.tar.xz linux-05e792e30ed039b5d202d31b86ba0d0491cd6f3c.zip |
signal/arm: Push siginfo generation into arm_notify_die
In arm_notify_die call force_sig_fault to let the generic
code handle siginfo generation.
This removes some boiler plate making the code easier to
maintain in the long run.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/arm/kernel/swp_emulate.c')
-rw-r--r-- | arch/arm/kernel/swp_emulate.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index 80517f293eb9..a188d5e8ab7f 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c @@ -98,22 +98,20 @@ static int proc_status_show(struct seq_file *m, void *v) */ static void set_segfault(struct pt_regs *regs, unsigned long addr) { - siginfo_t info; + int si_code; - clear_siginfo(&info); down_read(¤t->mm->mmap_sem); if (find_vma(current->mm, addr) == NULL) - info.si_code = SEGV_MAPERR; + si_code = SEGV_MAPERR; else - info.si_code = SEGV_ACCERR; + si_code = SEGV_ACCERR; up_read(¤t->mm->mmap_sem); - info.si_signo = SIGSEGV; - info.si_errno = 0; - info.si_addr = (void *) instruction_pointer(regs); - pr_debug("SWP{B} emulation: access caused memory abort!\n"); - arm_notify_die("Illegal memory access", regs, &info, 0, 0); + arm_notify_die("Illegal memory access", regs, + SIGSEGV, si_code, + (void __user *)instruction_pointer(regs), + 0, 0); abtcounter++; } |