CHROMIUM: signal: stop info leak via the tkill and the tgkill syscalls
authorEmese Revfy <re.emese@gmail.com>
Wed, 17 Apr 2013 19:03:26 +0000 (12:03 -0700)
committerChromeBot <chrome-bot@google.com>
Thu, 18 Apr 2013 22:56:46 +0000 (15:56 -0700)
This fixes a kernel memory contents leak via the tkill and tgkill syscalls
for compat processes.

This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field
when handling signals delivered from tkill.

The place of the infoleak:

int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
{
        ...
        put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
        ...
}

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Reviewed-by: PaX Team <pageexec@freemail.hu>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
BUG=chromium:223444
TEST=link build, PoC fails to show leaks

[ sent to lkml: http://marc.info/?l=linux-kernel&m=136622640810847&w=2 ]
Change-Id: If7603776a2f5dc28dceef4034f80b6979d18ca80
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48390
Reviewed-by: Will Drewry <wad@chromium.org>
kernel/signal.c

index d620679..0921e26 100644 (file)
@@ -2876,7 +2876,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)
 
 static int do_tkill(pid_t tgid, pid_t pid, int sig)
 {
-       struct siginfo info;
+       struct siginfo info = {};
 
        info.si_signo = sig;
        info.si_errno = 0;