summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-11-02 21:18:07 +0000
committerps <ps@FreeBSD.org>2005-11-02 21:18:07 +0000
commite0951fe5041ade134381562a4cbf4bc0e2fb7219 (patch)
tree579fb2f2f747602f163048fe8fc4c723adbadd1a /sys/kern
parent830d2103fbe6636ab7adf8d4fb308b9a383be46f (diff)
downloadFreeBSD-src-e0951fe5041ade134381562a4cbf4bc0e2fb7219.zip
FreeBSD-src-e0951fe5041ade134381562a4cbf4bc0e2fb7219.tar.gz
Calling setrlimit from 32bit apps could potentially increase certain
limits beyond what should be capiable in a 32bit process, so we must fixup the limits. Reviewed by: jhb
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exec.c2
-rw-r--r--sys/kern/kern_resource.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 78b4a04..811bd9f 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -908,7 +908,7 @@ exec_new_vmspace(imgp, sv)
* sense for the 32 bit binary.
*/
if (sv->sv_fixlimits != NULL)
- sv->sv_fixlimits(imgp);
+ sv->sv_fixlimits(p);
/*
* Blow away entire process VM, if address space not shared,
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index cb5b73d..397a7c5 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -655,6 +655,13 @@ kern_setrlimit(td, which, limp)
addr, addr + size, prot, FALSE);
}
}
+
+ /*
+ * The data size limit may need to be changed to a value
+ * that makes sense for the 32 bit binary.
+ */
+ if (p->p_sysent->sv_fixlimits != NULL)
+ p->p_sysent->sv_fixlimits(p);
return (0);
}
OpenPOWER on IntegriCloud