summaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-01-05 18:27:42 -0500
committerEric W. Biederman <ebiederm@xmission.com>2018-01-12 15:21:07 -0500
commitfaf1f22b61f2715224ba9b579e2a983e99b86823 (patch)
treefb871c31027141a61c4e1d898d967df6baab025d /fs/fcntl.c
parent8c5dbf2ae00bb8667f61c5edc6521c1fa2bbe4d7 (diff)
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 'fs/fcntl.c')
-rw-r--r--fs/fcntl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 0522e283a4f4..c17369659f4a 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -737,6 +737,7 @@ static void send_sigio_to_task(struct task_struct *p,
737 delivered even if we can't queue. Failure to 737 delivered even if we can't queue. Failure to
738 queue in this case _should_ be reported; we fall 738 queue in this case _should_ be reported; we fall
739 back to SIGIO in that case. --sct */ 739 back to SIGIO in that case. --sct */
740 clear_siginfo(&si);
740 si.si_signo = signum; 741 si.si_signo = signum;
741 si.si_errno = 0; 742 si.si_errno = 0;
742 si.si_code = reason; 743 si.si_code = reason;