summaryrefslogtreecommitdiffstats
path: root/sys/compat/ia32
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-07-12 18:01:31 +0000
committerjhb <jhb@FreeBSD.org>2007-07-12 18:01:31 +0000
commitef42e8706be34f667d7c85b11f408bec22cb3b77 (patch)
treec78cff16168bf26e653ac32e1c954ba6ed15af12 /sys/compat/ia32
parent77c677502e8fa12be84a874b37a001e2ee7f53a4 (diff)
downloadFreeBSD-src-ef42e8706be34f667d7c85b11f408bec22cb3b77.zip
FreeBSD-src-ef42e8706be34f667d7c85b11f408bec22cb3b77.tar.gz
Fix a couple of issues with the stack limit for 32-bit processes on 64-bit
kernels exposed by the recent fixes to resource limits for 32-bit processes on 64-bit kernels: - Let ABIs expose their maximum stack size via a new pointer in sysentvec and use that in preference to maxssiz during exec() rather than always using maxssiz for all processses. - Apply the ABI's limit fixup to the previous stack size when adjusting RLIMIT_STACK to determine if the existing mapping for the stack needs to be grown or shrunk (as well as how much it should be grown or shrunk). Approved by: re (kensmith)
Diffstat (limited to 'sys/compat/ia32')
-rw-r--r--sys/compat/ia32/ia32_sysvec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index f618934..6277926 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -100,6 +100,13 @@ extern struct sysent freebsd32_sysent[];
SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode");
+static u_long ia32_maxdsiz = IA32_MAXDSIZ;
+SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RW, &ia32_maxdsiz, 0, "");
+static u_long ia32_maxssiz = IA32_MAXSSIZ;
+SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxssiz, CTLFLAG_RW, &ia32_maxssiz, 0, "");
+static u_long ia32_maxvmem = IA32_MAXVMEM;
+SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RW, &ia32_maxvmem, 0, "");
+
struct sysentvec ia32_freebsd_sysvec = {
FREEBSD32_SYS_MAXSYSCALL,
freebsd32_sysent,
@@ -126,7 +133,8 @@ struct sysentvec ia32_freebsd_sysvec = {
VM_PROT_ALL,
ia32_copyout_strings,
ia32_setregs,
- ia32_fixlimit
+ ia32_fixlimit,
+ &ia32_maxssiz
};
@@ -273,13 +281,6 @@ ia32_copyout_strings(struct image_params *imgp)
return ((register_t *)stack_base);
}
-static u_long ia32_maxdsiz = IA32_MAXDSIZ;
-SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RW, &ia32_maxdsiz, 0, "");
-static u_long ia32_maxssiz = IA32_MAXSSIZ;
-SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxssiz, CTLFLAG_RW, &ia32_maxssiz, 0, "");
-static u_long ia32_maxvmem = IA32_MAXVMEM;
-SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RW, &ia32_maxvmem, 0, "");
-
static void
ia32_fixlimit(struct rlimit *rl, int which)
{
OpenPOWER on IntegriCloud