Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Bounds process's stack size with max_stack_size so ...



details:   https://anonhg.NetBSD.org/src/rev/3c2ccd68c160
branches:  trunk
changeset: 768086:3c2ccd68c160
user:      enami <enami%NetBSD.org@localhost>
date:      Mon Aug 08 06:30:43 2011 +0000

description:
Bounds process's stack size with max_stack_size so that 32bit
binary works regardless of stack size limit setting.

diffstat:

 sys/kern/exec_subr.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r c70c18645a67 -r 3c2ccd68c160 sys/kern/exec_subr.c
--- a/sys/kern/exec_subr.c      Sun Aug 07 21:38:32 2011 +0000
+++ b/sys/kern/exec_subr.c      Mon Aug 08 06:30:43 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $      */
+/*     $NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $     */
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $");
 
 #include "opt_pax.h"
 
@@ -404,7 +404,8 @@
            (unsigned long long)epp->ep_minsaddr,
            (unsigned long long)max_stack_size));
 
-       epp->ep_ssize = l->l_proc->p_rlimit[RLIMIT_STACK].rlim_cur;
+       epp->ep_ssize = MIN(l->l_proc->p_rlimit[RLIMIT_STACK].rlim_cur,
+           max_stack_size);
 
 #ifdef PAX_ASLR
        pax_aslr_stack(l, epp, &max_stack_size);



Home | Main Index | Thread Index | Old Index