Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/compat/sunos32 Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/82896eaa7a0e
branches:  netbsd-9
changeset: 376538:82896eaa7a0e
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jun 21 21:24:37 2023 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #1650):

        sys/compat/sunos32/sunos32_misc.c: revision 1.86
        sys/compat/ossaudio/ossaudio.c: revision 1.85
        sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.48

compat_sunos32: Memset zero before copyout.

Unclear if this can leak anything but let's be on the safe side.

compat_ossaudio: Zero-initialize idat before copyout.
Unclear if there are any paths to the copyout without initialization,
but let's play it safe to keep the auditing effort low.

linux32_rt_sendsig: Memset zero before copyout.
Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.

diffstat:

 sys/compat/linux32/arch/amd64/linux32_machdep.c |  5 +++--
 sys/compat/ossaudio/ossaudio.c                  |  6 +++---
 sys/compat/sunos32/sunos32_misc.c               |  5 +++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r 7b64c93d7d14 -r 82896eaa7a0e sys/compat/linux32/arch/amd64/linux32_machdep.c
--- a/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 19:52:39 2023 +0000
+++ b/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 21:24:37 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_machdep.c,v 1.45.2.1 2022/08/03 11:11:33 martin Exp $ */
+/*     $NetBSD: linux32_machdep.c,v 1.45.2.2 2023/06/21 21:24:38 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.45.2.1 2022/08/03 11:11:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.45.2.2 2023/06/21 21:24:38 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_user_ldt.h"
@@ -195,6 +195,7 @@ linux32_rt_sendsig(const ksiginfo_t *ksi
        fp--;
 
        /* Build stack frame for signal trampoline. */
+       memset(&frame, 0, sizeof(frame));
        NETBSD32PTR32(frame.sf_handler, catcher);
        frame.sf_sig = native_to_linux32_signo[sig];
        NETBSD32PTR32(frame.sf_sip, &fp->sf_si);
diff -r 7b64c93d7d14 -r 82896eaa7a0e sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 19:52:39 2023 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 21:24:37 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.74.4.5 2022/08/03 11:11:32 martin Exp $ */
+/*     $NetBSD: ossaudio.c,v 1.74.4.6 2023/06/21 21:24:37 martin Exp $ */
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.74.4.5 2022/08/03 11:11:32 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.74.4.6 2023/06/21 21:24:37 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1069,7 +1069,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
        mixer_ctrl_t mc;
        struct oss_mixer_info omi;
        struct audio_device adev;
-       int idat;
+       int idat = 0;
        int i;
        int error;
        int l, r, n, e;
diff -r 7b64c93d7d14 -r 82896eaa7a0e sys/compat/sunos32/sunos32_misc.c
--- a/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 19:52:39 2023 +0000
+++ b/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 21:24:37 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos32_misc.c,v 1.79.4.1 2022/08/03 11:11:33 martin Exp $     */
+/*     $NetBSD: sunos32_misc.c,v 1.79.4.2 2023/06/21 21:24:37 martin Exp $     */
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.79.4.1 2022/08/03 11:11:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.79.4.2 2023/06/21 21:24:37 martin Exp $");
 
 #define COMPAT_SUNOS 1
 
@@ -242,6 +242,7 @@ static inline void sunos32_from___stat13
 static inline void
 sunos32_from___stat13(struct stat *sbp, struct netbsd32_stat43 *sb32p)
 {
+       memset(sb32p, 0, sizeof(*sb32p));
        sb32p->st_dev = sbp->st_dev;
        sb32p->st_ino = sbp->st_ino;
        sb32p->st_mode = sbp->st_mode;



Home | Main Index | Thread Index | Old Index