Module Name:    src
Committed By:   martin
Date:           Wed Jun 21 21:13:27 UTC 2023

Modified Files:
        src/sys/compat/common [netbsd-8]: kern_time_50.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1838):

        sys/compat/common/kern_time_50.c: revision 1.32

Zero ntptimeval50 too to prevent 4-byte kernel stack disclosure.

>From Thomas Barabosch of Fraunhofer FKIE.


To generate a diff of this commit:
cvs rdiff -u -r1.31.10.1 -r1.31.10.2 src/sys/compat/common/kern_time_50.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.31.10.1 src/sys/compat/common/kern_time_50.c:1.31.10.2
--- src/sys/compat/common/kern_time_50.c:1.31.10.1	Wed Jun 21 21:04:01 2023
+++ src/sys/compat/common/kern_time_50.c	Wed Jun 21 21:13:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.31.10.1 2023/06/21 21:04:01 martin Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.31.10.2 2023/06/21 21:13:27 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.31.10.1 2023/06/21 21:04:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.31.10.2 2023/06/21 21:13:27 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -528,6 +528,7 @@ compat_50_sys___ntp_gettime30(struct lwp
 
 	if (SCARG(uap, ntvp)) {
 		ntp_gettime(&ntv);
+		memset(&ntv50, 0, sizeof(ntv50));
 		timespec_to_timespec50(&ntv.time, &ntv50.time);
 		ntv50.maxerror = ntv.maxerror;
 		ntv50.esterror = ntv.esterror;

Reply via email to