Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by maxv...



details:   https://anonhg.NetBSD.org/src/rev/be2de308540a
branches:  netbsd-8
changeset: 453768:be2de308540a
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 11 10:04:03 2019 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1333):

        sys/kern/sys_lwp.c: revision 1.69 (patch)

Fix info leak: instead of using SS_INIT as a literal compound, use a global
variable from rodata. The compound gets pushed on the stack, the padding
of the structure was therefore not initialized, and was getting leaked to
userland in sys___sigaltstack14().

diffstat:

 sys/kern/sys_lwp.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 5b8308e2b511 -r be2de308540a sys/kern/sys_lwp.c
--- a/sys/kern/sys_lwp.c        Sun Aug 11 10:01:14 2019 +0000
+++ b/sys/kern/sys_lwp.c        Sun Aug 11 10:04:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_lwp.c,v 1.61 2017/06/01 02:45:13 chs Exp $ */
+/*     $NetBSD: sys_lwp.c,v 1.61.2.1 2019/08/11 10:04:03 martin Exp $  */
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.61 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.61.2.1 2019/08/11 10:04:03 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -53,6 +53,8 @@
 
 #define        LWP_UNPARK_MAX          1024
 
+static const stack_t lwp_ss_init = SS_INIT;
+
 static syncobj_t lwp_park_sobj = {
        SOBJ_SLEEPQ_LIFO,
        sleepq_unsleep,
@@ -86,7 +88,7 @@
                return ENOMEM;
 
        error = lwp_create(l, p, uaddr, flags & LWP_DETACHED, NULL, 0,
-           p->p_emul->e_startlwp, arg, &l2, l->l_class, sigmask, &SS_INIT);
+           p->p_emul->e_startlwp, arg, &l2, l->l_class, sigmask, &lwp_ss_init);
        if (__predict_false(error)) {
                uvm_uarea_free(uaddr);
                return error;



Home | Main Index | Thread Index | Old Index