Module Name: src
Committed By: maxv
Date: Sat Dec 1 14:05:34 UTC 2018
Modified Files:
src/sys/kern: sys_sig.c
Log Message:
Fix kernel info leak, 4 bytes of padding in struct _ksiginfo. Maybe we
should just set _pad to zero on LP64?
+ Possible info leak: [len=40, leaked=4]
| #0 0xffffffff80baf397 in kleak_copyout
| #1 0xffffffff80bda817 in sigtimedwait1
| #2 0xffffffff80bdab95 in sys_____sigtimedwait50
| #3 0xffffffff80259c42 in syscall
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/sys_sig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.46 src/sys/kern/sys_sig.c:1.47
--- src/sys/kern/sys_sig.c:1.46 Thu Aug 4 06:43:43 2016
+++ src/sys/kern/sys_sig.c Sat Dec 1 14:05:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_sig.c,v 1.46 2016/08/04 06:43:43 christos Exp $ */
+/* $NetBSD: sys_sig.c,v 1.47 2018/12/01 14:05:33 maxv Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.46 2016/08/04 06:43:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.47 2018/12/01 14:05:33 maxv Exp $");
#include "opt_dtrace.h"
@@ -766,6 +766,8 @@ sigtimedwait1(struct lwp *l, const struc
*/
sigminusset(&sigcantmask, &l->l_sigwaitset);
+ memset(&ksi.ksi_info, 0, sizeof(ksi.ksi_info));
+
mutex_enter(p->p_lock);
/* Check for pending signals in the process, if no - then in LWP. */