Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/e48e7c9390f1
branches:  netbsd-7
changeset: 446317:e48e7c9390f1
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Nov 30 10:36:09 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 a53606d48933 -r e48e7c9390f1 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Thu Nov 29 08:57:16 2018 +0000
+++ b/sys/kern/kern_sig.c       Fri Nov 30 10:36:09 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.2 2018/11/30 10:36:09 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.2 2018/11/30 10:36:09 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