Module Name:    src
Committed By:   maxv
Date:           Fri Aug 23 07:53:37 UTC 2019

Modified Files:
        src/sys/compat/linux/common: linux_file64.c linux_misc.c
        src/sys/compat/linux32/common: linux32_dirent.c

Log Message:
Fix info leaks.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.241 -r1.242 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_dirent.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/linux/common/linux_file64.c
diff -u src/sys/compat/linux/common/linux_file64.c:1.61 src/sys/compat/linux/common/linux_file64.c:1.62
--- src/sys/compat/linux/common/linux_file64.c:1.61	Fri Aug 23 06:54:54 2019
+++ src/sys/compat/linux/common/linux_file64.c	Fri Aug 23 07:53:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $	*/
+/*	$NetBSD: linux_file64.c,v 1.62 2019/08/23 07:53:36 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.62 2019/08/23 07:53:36 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -353,6 +353,7 @@ again:
 		 * we have to worry about touching user memory outside of
 		 * the copyout() call).
 		 */
+		memset(&idb, 0, sizeof(idb));
 		idb.d_ino = bdp->d_fileno;
 		idb.d_type = bdp->d_type;
 		idb.d_off = off;

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.241 src/sys/compat/linux/common/linux_misc.c:1.242
--- src/sys/compat/linux/common/linux_misc.c:1.241	Fri Aug 23 06:47:58 2019
+++ src/sys/compat/linux/common/linux_misc.c	Fri Aug 23 07:53:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -772,6 +772,7 @@ again:
 		 * we have to worry about touching user memory outside of
 		 * the copyout() call).
 		 */
+		memset(&idb, 0, sizeof(idb));
 		idb.d_ino = bdp->d_fileno;
 		/*
 		 * The old readdir() call misuses the offset and reclen fields.

Index: src/sys/compat/linux32/common/linux32_dirent.c
diff -u src/sys/compat/linux32/common/linux32_dirent.c:1.19 src/sys/compat/linux32/common/linux32_dirent.c:1.20
--- src/sys/compat/linux32/common/linux32_dirent.c:1.19	Mon Sep  3 16:29:29 2018
+++ src/sys/compat/linux32/common/linux32_dirent.c	Fri Aug 23 07:53:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_dirent.c,v 1.19 2018/09/03 16:29:29 riastradh Exp $ */
+/*	$NetBSD: linux32_dirent.c,v 1.20 2019/08/23 07:53:36 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.19 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.20 2019/08/23 07:53:36 maxv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -201,6 +201,7 @@ again:
 		 * we have to worry about touching user memory outside of
 		 * the copyout() call).
 		 */
+		memset(&idb, 0, sizeof(idb));
 		idb.d_ino = bdp->d_fileno;
 		/*
 		 * The old readdir() call misuses the offset and reclen fields.

Reply via email to