diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2016-03-04 01:42:49 +0000 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-03-13 13:53:41 -0400 |
commit | b8882250c376aaa4413b535692d5c6ba20a84800 (patch) | |
tree | b0a9f57790bf6c685ffaba056955f41e6ed76be3 | |
parent | 13dd5b79a6c0c3991ccee05b79722e0a38f3f6ae (diff) | |
download | lwn-b8882250c376aaa4413b535692d5c6ba20a84800.tar.gz lwn-b8882250c376aaa4413b535692d5c6ba20a84800.zip |
MIPS: traps: Fix SIGFPE information leak from `do_ov' and `do_trap_or_bp'
[ Upstream commit e723e3f7f9591b79e8c56b3d7c5a204a9c571b55 ]
Avoid sending a partially initialised `siginfo_t' structure along SIGFPE
signals issued from `do_ov' and `do_trap_or_bp', leading to information
leaking from the kernel stack.
Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | arch/mips/kernel/traps.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index f506c53cb4f5..2012a5a3055b 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -692,15 +692,15 @@ static int simulate_sync(struct pt_regs *regs, unsigned int opcode) asmlinkage void do_ov(struct pt_regs *regs) { enum ctx_state prev_state; - siginfo_t info; + siginfo_t info = { + .si_signo = SIGFPE, + .si_code = FPE_INTOVF, + .si_addr = (void __user *)regs->cp0_epc, + }; prev_state = exception_enter(); die_if_kernel("Integer overflow", regs); - info.si_code = FPE_INTOVF; - info.si_signo = SIGFPE; - info.si_errno = 0; - info.si_addr = (void __user *) regs->cp0_epc; force_sig_info(SIGFPE, &info, current); exception_exit(prev_state); } @@ -803,7 +803,7 @@ out: static void do_trap_or_bp(struct pt_regs *regs, unsigned int code, const char *str) { - siginfo_t info; + siginfo_t info = { 0 }; char b[40]; #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP @@ -831,7 +831,6 @@ static void do_trap_or_bp(struct pt_regs *regs, unsigned int code, else info.si_code = FPE_INTOVF; info.si_signo = SIGFPE; - info.si_errno = 0; info.si_addr = (void __user *) regs->cp0_epc; force_sig_info(SIGFPE, &info, current); break; |