diff options
author | Guo Ren <ren_guo@c-sky.com> | 2019-05-10 17:07:01 +0800 |
---|---|---|
committer | Guo Ren <ren_guo@c-sky.com> | 2019-07-19 14:21:36 +0800 |
commit | 3158d28953fcd85492b28b1d2d5a5e20bb62a626 (patch) | |
tree | 9dbd456c78546d59f598a1184e1c583d5e897305 | |
parent | 1994cc49f18b47a18dfb0371063fc9d80c464b33 (diff) | |
download | linux-3158d28953fcd85492b28b1d2d5a5e20bb62a626.tar.gz linux-3158d28953fcd85492b28b1d2d5a5e20bb62a626.tar.bz2 linux-3158d28953fcd85492b28b1d2d5a5e20bb62a626.zip |
csky: Fixup no panic in kernel for some traps
These traps couldn't be hanppen in kernel and we must panic there not
send a signal to userspace.
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Cc: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/csky/kernel/traps.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/csky/kernel/traps.c b/arch/csky/kernel/traps.c index f487a9b996ae..6129f30faf6e 100644 --- a/arch/csky/kernel/traps.c +++ b/arch/csky/kernel/traps.c @@ -120,6 +120,7 @@ asmlinkage void trap_c(struct pt_regs *regs) switch (vector) { case VEC_ZERODIV: + die_if_kernel("Kernel mode ZERO DIV", regs, vector); sig = SIGFPE; break; /* ptrace */ @@ -128,6 +129,7 @@ asmlinkage void trap_c(struct pt_regs *regs) sig = SIGTRAP; break; case VEC_ILLEGAL: + die_if_kernel("Kernel mode ILLEGAL", regs, vector); #ifndef CONFIG_CPU_NO_USER_BKPT if (*(uint16_t *)instruction_pointer(regs) != USR_BKPT) #endif @@ -139,6 +141,7 @@ asmlinkage void trap_c(struct pt_regs *regs) case VEC_TRAP1: /* jtagserver breakpoint */ case VEC_BREAKPOINT: + die_if_kernel("Kernel mode BKPT", regs, vector); info.si_code = TRAP_BRKPT; sig = SIGTRAP; break; @@ -150,8 +153,10 @@ asmlinkage void trap_c(struct pt_regs *regs) #endif #ifdef CONFIG_CPU_HAS_FPU case VEC_FPE: + die_if_kernel("Kernel mode FPE", regs, vector); return fpu_fpe(regs); case VEC_PRIV: + die_if_kernel("Kernel mode PRIV", regs, vector); if (fpu_libc_helper(regs)) return; #endif |