Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux32/arch/amd64 linux32_rt_sendsig: Memset zer...



details:   https://anonhg.NetBSD.org/src/rev/166dba6b0082
branches:  trunk
changeset: 376491:166dba6b0082
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jun 20 15:22:15 2023 +0000

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

XXX pullup-8
XXX pullup-9
XXX pullup-10

diffstat:

 sys/compat/linux32/arch/amd64/linux32_machdep.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 2b69d8269e31 -r 166dba6b0082 sys/compat/linux32/arch/amd64/linux32_machdep.c
--- a/sys/compat/linux32/arch/amd64/linux32_machdep.c   Tue Jun 20 15:22:04 2023 +0000
+++ b/sys/compat/linux32/arch/amd64/linux32_machdep.c   Tue Jun 20 15:22:15 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.48 2023/06/20 15:22:15 riastradh 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.48 2023/06/20 15:22:15 riastradh 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);



Home | Main Index | Thread Index | Old Index