Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Fix kernel info leak. There are 4 bytes of padding ...
details: https://anonhg.NetBSD.org/src/rev/548c8fbb8027
branches: trunk
changeset: 445797:548c8fbb8027
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Nov 13 06:58:14 2018 +0000
description:
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 a215b7d0ee37 -r 548c8fbb8027 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Tue Nov 13 06:57:14 2018 +0000
+++ b/sys/kern/kern_event.c Tue Nov 13 06:58:14 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.103 2018/01/12 17:58:51 christos Exp $ */
+/* $NetBSD: kern_event.c,v 1.104 2018/11/13 06:58:14 maxv 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.103 2018/01/12 17:58:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.104 2018/11/13 06:58:14 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -632,6 +632,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