diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-01-06 00:27:42 +0100 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-01-12 21:21:07 +0100 |
commit | faf1f22b61f2715224ba9b579e2a983e99b86823 (patch) | |
tree | fb871c31027141a61c4e1d898d967df6baab025d /ipc/mqueue.c | |
parent | signal: Introduce clear_siginfo (diff) | |
download | linux-faf1f22b61f2715224ba9b579e2a983e99b86823.tar.xz linux-faf1f22b61f2715224ba9b579e2a983e99b86823.zip |
signal: Ensure generic siginfos the kernel sends have all bits initialized
Call clear_siginfo to ensure stack allocated siginfos are fully
initialized before being passed to the signal sending functions.
This ensures that if there is the kind of confusion documented by
TRAP_FIXME, FPE_FIXME, or BUS_FIXME the kernel won't send unitialized
data to userspace when the kernel generates a signal with SI_USER but
the copy to userspace assumes it is a different kind of signal, and
different fields are initialized.
This also prepares the way for turning copy_siginfo_to_user
into a copy_to_user, by removing the need in many cases to perform
a field by field copy simply to skip the uninitialized fields.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 9649ecd8a73a..17bc8b874d92 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -639,6 +639,7 @@ static void __do_notify(struct mqueue_inode_info *info) case SIGEV_SIGNAL: /* sends signal */ + clear_siginfo(&sig_i); sig_i.si_signo = info->notify.sigev_signo; sig_i.si_errno = 0; sig_i.si_code = SI_MESGQ; |