summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2016-05-23 15:35:51 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-05-23 16:45:25 +0200
commitcf0d44d513f275be9ce42158079d4257e8973889 (patch)
treee2a6d7b9108260e8ab0aa327a129422fb089862d /arch/s390
parente9bc15f28e5f0db44aba609780d6850eabefbf11 (diff)
downloadlinux-cf0d44d513f275be9ce42158079d4257e8973889.tar.bz2
s390: fix info leak in do_sigsegv
Aleksa has reported incorrect si_errno value when stracing task which received SIGSEGV: [pid 20799] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_errno=2510266, si_addr=0x100000000000000} The reason seems to be that do_sigsegv is not initializing siginfo structure defined on the stack completely so it will leak 4B of the previous stack content. Fix it simply by initializing si_errno to 0 (same as do_sigbus does already). Cc: stable # introduced pre-git times Reported-by: Aleksa Sarai <asarai@suse.de> Signed-off-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/mm/fault.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 7a3144017301..19288c1b36d3 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -250,6 +250,7 @@ static noinline void do_sigsegv(struct pt_regs *regs, int si_code)
report_user_fault(regs, SIGSEGV, 1);
si.si_signo = SIGSEGV;
+ si.si_errno = 0;
si.si_code = si_code;
si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK);
force_sig_info(SIGSEGV, &si, current);