Source-Changes-HG archive

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

[src/trunk]: src/sys/compat Fix info leaks in sigaltstack.



details:   https://anonhg.NetBSD.org/src/rev/46548d07afcf
branches:  trunk
changeset: 453704:46548d07afcf
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Aug 23 08:31:11 2019 +0000

description:
Fix info leaks in sigaltstack.

diffstat:

 sys/compat/linux/common/linux_signal.c     |  5 +++--
 sys/compat/linux32/common/linux32_signal.c |  5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 33a4e48a60fb -r 46548d07afcf sys/compat/linux/common/linux_signal.c
--- a/sys/compat/linux/common/linux_signal.c    Fri Aug 23 08:17:26 2019 +0000
+++ b/sys/compat/linux/common/linux_signal.c    Fri Aug 23 08:31:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $       */
+/*     $NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $   */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $");
 
 #define COMPAT_LINUX 1
 
@@ -683,6 +683,7 @@
 void
 native_to_linux_sigaltstack(struct linux_sigaltstack *lss, const struct sigaltstack *bss)
 {
+       memset(lss, 0, sizeof(*lss));
        lss->ss_sp = bss->ss_sp;
        lss->ss_size = bss->ss_size;
        if (bss->ss_flags & SS_ONSTACK)
diff -r 33a4e48a60fb -r 46548d07afcf sys/compat/linux32/common/linux32_signal.c
--- a/sys/compat/linux32/common/linux32_signal.c        Fri Aug 23 08:17:26 2019 +0000
+++ b/sys/compat/linux32/common/linux32_signal.c        Fri Aug 23 08:31:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_signal.c,v 1.19 2018/01/07 21:16:00 christos Exp $ */
+/*     $NetBSD: linux32_signal.c,v 1.20 2019/08/23 08:31:11 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.19 2018/01/07 21:16:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.20 2019/08/23 08:31:11 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -232,6 +232,7 @@
 void
 native_to_linux32_sigaltstack(struct linux32_sigaltstack *lss, const struct sigaltstack *bss)
 {
+       memset(lss, 0, sizeof(*lss));
        NETBSD32PTR32(lss->ss_sp, bss->ss_sp);
        lss->ss_size = bss->ss_size;
        if (bss->ss_flags & SS_ONSTACK)



Home | Main Index | Thread Index | Old Index