wait: Do not copyout uninitialized status/rusage/wrusage.
authorjilles <jilles@FreeBSD.org>
Fri, 9 Sep 2016 21:58:48 +0000 (21:58 +0000)
committerjilles <jilles@FreeBSD.org>
Fri, 9 Sep 2016 21:58:48 +0000 (21:58 +0000)
commitb8f715c74fafdffbfbd366003f3ee04601b6d7cc
tree242925e478b7182e1b36a41e9957bc2476118cf3
parent1f03f894b86c84cb2eea74d3a8f914ce0acc9f20
wait: Do not copyout uninitialized status/rusage/wrusage.

If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.

PR: 212048
Reported by: Casey Lucas
MFC after: 2 weeks
sys/kern/kern_exit.c
tests/sys/kern/Makefile
tests/sys/kern/waitpid_nohang.c [new file with mode: 0644]