Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-1]: src/sys/kern Pull up following revision(s) (requested by ma...



details:   https://anonhg.NetBSD.org/src/rev/1ff368833d58
branches:  netbsd-7-1
changeset: 800933:1ff368833d58
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Nov 30 10:39:14 2018 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1661):

        sys/kern/kern_sig.c: revision 1.350

Fix kernel info leak, 4 bytes of padding at the end of struct sigaction.

        + Possible info leak: [len=32, leaked=4]
        | #0 0xffffffff80baf327 in kleak_copyout
        | #1 0xffffffff80bd9ca8 in sys___sigaction_sigtramp
        | #2 0xffffffff80259c42 in syscall

diffstat:

 sys/kern/kern_sig.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 92287a223a65 -r 1ff368833d58 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Thu Nov 29 08:59:49 2018 +0000
+++ b/sys/kern/kern_sig.c       Fri Nov 30 10:39:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.319.4.1 2015/11/05 09:21:30 snj Exp $   */
+/*     $NetBSD: kern_sig.c,v 1.319.4.1.4.1 2018/11/30 10:39:14 martin Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.319.4.1 2015/11/05 09:21:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.319.4.1.4.1 2018/11/30 10:39:14 martin Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -191,6 +191,13 @@
        return result;
 }
 
+static int
+sigacts_ctor(void *arg __unused, void *obj, int flags __unused)
+{
+       memset(obj, 0, sizeof(struct sigacts));
+       return 0;
+}
+
 /*
  * signal_init:
  *
@@ -204,7 +211,7 @@
 
        sigacts_cache = pool_cache_init(sizeof(struct sigacts), 0, 0, 0,
            "sigacts", sizeof(struct sigacts) > PAGE_SIZE ?
-           &sigactspool_allocator : NULL, IPL_NONE, NULL, NULL, NULL);
+           &sigactspool_allocator : NULL, IPL_NONE, sigacts_ctor, NULL, NULL);
        ksiginfo_cache = pool_cache_init(sizeof(ksiginfo_t), 0, 0, 0,
            "ksiginfo", NULL, IPL_VM, NULL, NULL, NULL);
 



Home | Main Index | Thread Index | Old Index