diff options
author | jhb <jhb@FreeBSD.org> | 2007-05-14 22:40:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-05-14 22:40:04 +0000 |
commit | b667f507a0d1bcaa8341f4a46d61715783cde521 (patch) | |
tree | 22a683ee47ef279e53c999ab223b32ea3f9df550 /sys/kern/kern_exec.c | |
parent | 77d161b46b5af0e16571ad43b660bcafb3bc3039 (diff) | |
download | FreeBSD-src-b667f507a0d1bcaa8341f4a46d61715783cde521.zip FreeBSD-src-b667f507a0d1bcaa8341f4a46d61715783cde521.tar.gz |
Rework the support for ABIs to override resource limits (used by 32-bit
processes under 64-bit kernels). Previously, each 32-bit process overwrote
its resource limits at exec() time. The problem with this approach is that
the new limits affect all child processes of the 32-bit process, including
if the child process forks and execs a 64-bit process. To fix this, don't
ovewrite the resource limits during exec(). Instead, sv_fixlimits() is
now replaced with a different function sv_fixlimit() which asks the ABI to
sanitize a single resource limit. We then use this when querying and
setting resource limits. Thus, if a 32-bit process sets a limit, then
that new limit will be inherited by future children. However, if the
32-bit process doesn't change a limit, then a future 64-bit child will
see the "full" 64-bit limit rather than the 32-bit limit.
MFC is tentative since it will break the ABI of old linux.ko modules (no
other modules are affected).
MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index bbe12bf..65ee108b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -898,15 +898,6 @@ exec_new_vmspace(imgp, sv) EVENTHANDLER_INVOKE(process_exec, p, imgp); /* - * Here is as good a place as any to do any resource limit cleanups. - * This is needed if a 64 bit binary exec's a 32 bit binary - the - * data size limit may need to be changed to a value that makes - * sense for the 32 bit binary. - */ - if (sv->sv_fixlimits != NULL) - sv->sv_fixlimits(p); - - /* * Blow away entire process VM, if address space not shared, * otherwise, create a new VM space so that other threads are * not disrupted |