diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-11-17 18:55:51 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-11-17 18:55:51 +0000 |
commit | 230a4436bd3d2a1251126991f6306d7eea78c530 (patch) | |
tree | a35cab921d8751128aee86df4d865441fce605cd /sys/kern | |
parent | 8064fcb1dbb2784128119a0102b4760fc4e241a5 (diff) |
Avoid leaking kernel memory in struct kevent padding.
From NetBSD (maxv). OK deraadt@ visa@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_event.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 1af10f0b1b9..8a4ede8ae90 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.99 2018/09/04 02:38:25 cheloha Exp $ */ +/* $OpenBSD: kern_event.c,v 1.100 2018/11/17 18:55:50 millert Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -309,6 +309,7 @@ filt_proc(struct knote *kn, long hint) /* * 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; |