OSDN Git Service

signal: Clear si_sys_private before copying siginfo to userspace
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 24 Jul 2017 19:53:03 +0000 (14:53 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 12 Jan 2018 20:34:45 +0000 (14:34 -0600)
In preparation for unconditionally copying the whole of siginfo
to userspace clear si_sys_private.  So this kernel internal
value is guaranteed not to make it to userspace.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/signal.c

index b9e5d82..18aa55c 100644 (file)
@@ -643,6 +643,9 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
                spin_unlock(&tsk->sighand->siglock);
                posixtimer_rearm(info);
                spin_lock(&tsk->sighand->siglock);
+
+               /* Don't expose the si_sys_private value to userspace */
+               info->si_sys_private = 0;
        }
 #endif
        return signr;