summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/traps.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-09-22 11:26:57 +0300
committerEric W. Biederman <ebiederm@xmission.com>2018-09-27 22:54:43 +0300
commitfeca355b3d8eba3a2cbca63c97a59a14681983f7 (patch)
tree4c60ae9d111db5870f794d8de3d6640deaaae944 /arch/arm64/kernel/traps.c
parent559d8d91a89cc2a0190781a5b5ce3faeaef7920f (diff)
downloadlinux-feca355b3d8eba3a2cbca63c97a59a14681983f7.tar.xz
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/kernel/traps.c')
-rw-r--r--arch/arm64/kernel/traps.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index daee8c2ca561..37a3309863e0 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -248,6 +248,13 @@ static void arm64_show_signal(int signo, const char *str)
__show_regs(regs);
}
+void arm64_force_sig_fault(int signo, int code, void __user *addr,
+ const char *str)
+{
+ arm64_show_signal(signo, str);
+ force_sig_fault(signo, code, addr, current);
+}
+
void arm64_force_sig_info(struct siginfo *info, const char *str)
{
arm64_show_signal(info->si_signo, str);
@@ -259,19 +266,11 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
int err)
{
if (user_mode(regs)) {
- struct siginfo info;
-
WARN_ON(regs != current_pt_regs());
current->thread.fault_address = 0;
current->thread.fault_code = err;
- clear_siginfo(&info);
- info.si_signo = signo;
- info.si_errno = 0;
- info.si_code = sicode;
- info.si_addr = addr;
-
- arm64_force_sig_info(&info, str);
+ arm64_force_sig_fault(signo, sicode, addr, str);
} else {
die(str, regs, err);
}
@@ -616,19 +615,13 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
*/
asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
{
- siginfo_t info;
void __user *pc = (void __user *)instruction_pointer(regs);
- clear_siginfo(&info);
- info.si_signo = SIGILL;
- info.si_errno = 0;
- info.si_code = ILL_ILLOPC;
- info.si_addr = pc;
-
current->thread.fault_address = 0;
current->thread.fault_code = esr;
- arm64_force_sig_info(&info, "Bad EL0 synchronous exception");
+ arm64_force_sig_fault(SIGILL, ILL_ILLOPC, pc,
+ "Bad EL0 synchronous exception");
}
#ifdef CONFIG_VMAP_STACK