]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
fix infoleak in waitid(2)
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Sep 2017 17:43:15 +0000 (13:43 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:44 +0000 (16:20 -0500)
commit46d5aafd49ea90650aaa385acf6cafa2ae1eeb0b
tree8f22dca327fd0bfcdc77e41d08c99d142f46a7ce
parent2b555d7ef4554a6c9f0669e43f5aefc045e7d187
fix infoleak in waitid(2)

BugLink: http://bugs.launchpad.net/bugs/1721777
commit 6c85501f2fabcfc4fc6ed976543d252c4eaf4be9 upstream.

kernel_waitid() can return a PID, an error or 0.  rusage is filled in the first
case and waitid(2) rusage should've been copied out exactly in that case, *not*
whenever kernel_waitid() has not returned an error.  Compat variant shares that
braino; none of kernel_wait4() callers do, so the below ought to fix it.

Reported-and-tested-by: Alexander Potapenko <glider@google.com>
Fixes: ce72a16fa705 ("wait4(2)/waitid(2): separate copying rusage to userland")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
kernel/exit.c