Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/compat/common Apply patch, requested by riastradh in ...



details:   https://anonhg.NetBSD.org/src/rev/627cb1ea3d66
branches:  netbsd-9
changeset: 368772:627cb1ea3d66
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Aug 03 11:16:12 2022 +0000

description:
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.

diffstat:

 sys/compat/common/vfs_syscalls_20.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r e01ea41d9429 -r 627cb1ea3d66 sys/compat/common/vfs_syscalls_20.c
--- a/sys/compat/common/vfs_syscalls_20.c       Wed Aug 03 11:11:31 2022 +0000
+++ b/sys/compat/common/vfs_syscalls_20.c       Wed Aug 03 11:16:12 2022 +0000
@@ -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 @@
 {
        struct statfs12 ofs;
        int i;
+
+       memset(&ofs, 0, sizeof(ofs));
+
        ofs.f_type = 0;
        ofs.f_oflags = (short)fs->f_flag;
 



Home | Main Index | Thread Index | Old Index