Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/d325d70567eb
branches:  netbsd-8
changeset: 376555:d325d70567eb
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jun 21 21:26:16 2023 +0000

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

        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 7c6f8c19a73a -r d325d70567eb sys/compat/linux32/arch/amd64/linux32_machdep.c
--- a/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 21:19:38 2023 +0000
+++ b/sys/compat/linux32/arch/amd64/linux32_machdep.c   Wed Jun 21 21:26:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_machdep.c,v 1.38.6.3 2023/06/21 21:04:03 martin Exp $ */
+/*     $NetBSD: linux32_machdep.c,v 1.38.6.4 2023/06/21 21:26:16 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.38.6.3 2023/06/21 21:04:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.38.6.4 2023/06/21 21:26:16 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -191,6 +191,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 7c6f8c19a73a -r d325d70567eb sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 21:19:38 2023 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Wed Jun 21 21:26:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.70.6.4 2023/06/21 21:04:02 martin Exp $ */
+/*     $NetBSD: ossaudio.c,v 1.70.6.5 2023/06/21 21:26:16 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.70.6.4 2023/06/21 21:04:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.70.6.5 2023/06/21 21:26:16 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1041,7 +1041,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 7c6f8c19a73a -r d325d70567eb sys/compat/sunos32/sunos32_misc.c
--- a/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 21:19:38 2023 +0000
+++ b/sys/compat/sunos32/sunos32_misc.c Wed Jun 21 21:26:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos32_misc.c,v 1.77.10.2 2023/06/21 21:04:03 martin Exp $    */
+/*     $NetBSD: sunos32_misc.c,v 1.77.10.3 2023/06/21 21:26:16 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.77.10.2 2023/06/21 21:04:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.77.10.3 2023/06/21 21:26:16 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