Module Name:    src
Committed By:   martin
Date:           Wed Aug  3 11:16:12 UTC 2022

Modified Files:
        src/sys/compat/common [netbsd-9]: vfs_syscalls_20.c

Log Message:
Apply patch, requested by riastradh in ticket #1487:

        sys/compat/common/vfs_syscalls_20.c             (apply patch)

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure.  If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.4.1 src/sys/compat/common/vfs_syscalls_20.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/vfs_syscalls_20.c
diff -u src/sys/compat/common/vfs_syscalls_20.c:1.41 src/sys/compat/common/vfs_syscalls_20.c:1.41.4.1
--- src/sys/compat/common/vfs_syscalls_20.c:1.41	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/vfs_syscalls_20.c	Wed Aug  3 11:16:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_20.c,v 1.41 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls_20.c,v 1.41.4.1 2022/08/03 11:16:12 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.41 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.41.4.1 2022/08/03 11:16:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -103,6 +103,9 @@ vfs2fs(struct statfs12 *bfs, const struc
 {
 	struct statfs12 ofs;
 	int i;
+
+	memset(&ofs, 0, sizeof(ofs));
+
 	ofs.f_type = 0;
 	ofs.f_oflags = (short)fs->f_flag;
 

Reply via email to