提交 cf0d44d5 编写于 作者: M Michal Hocko 提交者: Martin Schwidefsky

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: NAleksa Sarai <asarai@suse.de>
Signed-off-by: NMichal Hocko <mhocko@suse.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 e9bc15f2
...@@ -250,6 +250,7 @@ static noinline void do_sigsegv(struct pt_regs *regs, int si_code) ...@@ -250,6 +250,7 @@ static noinline void do_sigsegv(struct pt_regs *regs, int si_code)
report_user_fault(regs, SIGSEGV, 1); report_user_fault(regs, SIGSEGV, 1);
si.si_signo = SIGSEGV; si.si_signo = SIGSEGV;
si.si_errno = 0;
si.si_code = si_code; si.si_code = si_code;
si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK); si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK);
force_sig_info(SIGSEGV, &si, current); force_sig_info(SIGSEGV, &si, current);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册