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/2ab73e910bf8
branches:  netbsd-7
changeset: 800571:2ab73e910bf8
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 21 12:12:15 2018 +0000

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

        sys/kern/kern_event.c: revision 1.104

Fix kernel info leak. There are 4 bytes of padding in struct kevent.
[  287.537676] kleak: Possible leak in copyout: [len=40, leaked=4]
[  287.537676] #0 0xffffffff80b7c41a in kleak_note <netbsd>
[  287.547673] #1 0xffffffff80b7c49a in kleak_copyout <netbsd>
[  287.557677] #2 0xffffffff80b1d32d in kqueue_scan.isra.1.constprop.2 <netbsd>
[  287.557677] #3 0xffffffff80b1dc6a in kevent1 <netbsd>
[  287.567683] #4 0xffffffff80b1dcb0 in sys___kevent50 <netbsd>
[  287.567683] #5 0xffffffff8025ab3c in sy_call <netbsd>
[  287.577688] #6 0xffffffff8025ad6e in sy_invoke <netbsd>
[  287.587693] #7 0xffffffff8025adf4 in syscall <netbsd>

diffstat:

 sys/kern/kern_event.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 0dff4dd7545b -r 2ab73e910bf8 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c     Wed Nov 21 12:09:03 2018 +0000
+++ b/sys/kern/kern_event.c     Wed Nov 21 12:12:15 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_event.c,v 1.80.2.2 2017/07/08 16:53:24 snj Exp $  */
+/*     $NetBSD: kern_event.c,v 1.80.2.3 2018/11/21 12:12:15 martin Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.2 2017/07/08 16:53:24 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.3 2018/11/21 12:12:15 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -584,6 +584,7 @@
                 * event with the parent's pid.  Register knote with new
                 * process.
                 */
+               memset(&kev, 0, sizeof(kev));
                kev.ident = hint & NOTE_PDATAMASK;      /* pid */
                kev.filter = kn->kn_filter;
                kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_FLAG1;



Home | Main Index | Thread Index | Old Index