diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-04-05 04:15:45 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-04-05 04:15:45 +0000 |
commit | acc4f1345f3dca5cdd5dbf949b774041b32c524b (patch) | |
tree | edc8ecaf013000d30d5b96909296b66d4ccd5f12 /sys | |
parent | e3fc28d3eb996a1117d17bd2c4ca3547140e1a09 (diff) |
timeval has trailing padding on powerpc and m88k, so memset it before
copyout to avoid leaking kernel stack
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sysctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index cb38823cfd0..d08767d14bc 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.323 2017/04/05 04:00:41 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.324 2017/04/05 04:15:44 guenther Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -370,6 +370,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_clockrate(oldp, oldlenp, newp)); case KERN_BOOTTIME: { struct timeval bt; + memset(&bt, 0, sizeof bt); TIMESPEC_TO_TIMEVAL(&bt, &boottime); return (sysctl_rdstruct(oldp, oldlenp, newp, &bt, sizeof bt)); } |