Module Name:    src
Committed By:   martin
Date:           Tue Feb 25 19:10:52 UTC 2020

Modified Files:
        src/sys/kern [netbsd-9]: uipc_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #720):

        sys/kern/uipc_socket.c: revision 1.288

Zero out 'tv', to prevent uninitialized bytes in its padding from leaking
to userland. Found by kMSan.


To generate a diff of this commit:
cvs rdiff -u -r1.281.2.1 -r1.281.2.2 src/sys/kern/uipc_socket.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/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.281.2.1 src/sys/kern/uipc_socket.c:1.281.2.2
--- src/sys/kern/uipc_socket.c:1.281.2.1	Mon Oct 21 20:06:17 2019
+++ src/sys/kern/uipc_socket.c	Tue Feb 25 19:10:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.281.2.1 2019/10/21 20:06:17 martin Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.281.2.2 2020/02/25 19:10:51 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.281.2.1 2019/10/21 20:06:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.281.2.2 2020/02/25 19:10:51 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1990,6 +1990,7 @@ sogetopt1(struct socket *so, struct sock
 		optval = (opt == SO_SNDTIMEO ?
 		     so->so_snd.sb_timeo : so->so_rcv.sb_timeo);
 
+		memset(&tv, 0, sizeof(tv));
 		tv.tv_sec = optval / hz;
 		tv.tv_usec = (optval % hz) * tick;
 

Reply via email to