linuxulator: fix stack memory disclosure in linux_sigaltstack

Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before
callit it, but linux_waitid did not.  Instead of zeroing in the called
function to address linux_waitid (as in commit 2e6ebe70), just do it in
linux_waitid.

admbugs:	765
Reported by:	Vlad Tsyrklevich <vlad@tsyrklevich.net>
Reviewed by:	Andrew
MFC after:	1 day
Security:	Kernel stack memory disclosure
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2019-01-21 17:12:16 +00:00
parent 1b1f24b936
commit 347a8ed1bf

View File

@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args)
}
if (args->info != NULL) {
p = td->td_proc;
if (td->td_retval[0] == 0)
bzero(&lsi, sizeof(lsi));
else {
bzero(&lsi, sizeof(lsi));
if (td->td_retval[0] != 0) {
sig = bsd_to_linux_signal(siginfo.si_signo);
siginfo_to_lsiginfo(&siginfo, &lsi, sig);
}