summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c2
-rw-r--r--sys/kern/kern_exec.c9
-rw-r--r--sys/kern/kern_resource.c10
3 files changed, 5 insertions, 16 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 09d7d5f..b992f2b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -667,6 +667,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
VOP_UNLOCK(imgp->vp, 0, td);
exec_new_vmspace(imgp, sv);
+ imgp->proc->p_sysent = sv;
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -784,7 +785,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
imgp->entry_addr = entry;
- imgp->proc->p_sysent = sv;
if (interp != NULL) {
VOP_UNLOCK(imgp->vp, 0, td);
if (brand_info->emul_path != NULL &&
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
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 32c27ed..647cee8 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -701,6 +701,8 @@ kern_setrlimit(td, which, limp)
limp->rlim_max = 1;
break;
}
+ if (td->td_proc->p_sysent->sv_fixlimit != NULL)
+ td->td_proc->p_sysent->sv_fixlimit(limp, which);
*alimp = *limp;
p->p_limit = newlim;
PROC_UNLOCK(p);
@@ -734,12 +736,6 @@ kern_setrlimit(td, which, limp)
}
}
- /*
- * 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);
}
@@ -1062,6 +1058,8 @@ lim_rlimit(struct proc *p, int which, struct rlimit *rlp)
KASSERT(which >= 0 && which < RLIM_NLIMITS,
("request for invalid resource limit"));
*rlp = p->p_limit->pl_rlimit[which];
+ if (p->p_sysent->sv_fixlimit != NULL)
+ p->p_sysent->sv_fixlimit(rlp, which);
}
/*
OpenPOWER on IntegriCloud