Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/a5973e24a814
branches:  netbsd-10
changeset: 376526:a5973e24a814
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jun 21 21:22:53 2023 +0000

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

        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 cf775b0afa75 -r a5973e24a814 sys/compat/linux32/arch/amd64/linux32_machdep.c
--- a/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 19:51:01 2023 +0000
+++ b/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 21:22:53 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_machdep.c,v 1.47 2021/11/01 05:07:16 thorpej Exp $ */
+/*     $NetBSD: linux32_machdep.c,v 1.47.4.1 2023/06/21 21:22:53 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.47 2021/11/01 05:07:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.47.4.1 2023/06/21 21:22:53 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 cf775b0afa75 -r a5973e24a814 sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 19:51:01 2023 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 21:22:53 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.84 2021/09/07 11:43:05 riastradh Exp $  */
+/*     $NetBSD: ossaudio.c,v 1.84.4.1 2023/06/21 21:22:53 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.84 2021/09/07 11:43:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.84.4.1 2023/06/21 21:22:53 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 cf775b0afa75 -r a5973e24a814 sys/compat/sunos32/sunos32_misc.c
--- a/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 19:51:01 2023 +0000
+++ b/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 21:22:53 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos32_misc.c,v 1.85 2021/09/07 11:43:05 riastradh Exp $      */
+/*     $NetBSD: sunos32_misc.c,v 1.85.4.1 2023/06/21 21:22:53 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.85 2021/09/07 11:43:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.85.4.1 2023/06/21 21:22:53 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