setrlimit: Remove special handling for RLIMIT_STACK with a stack gap

This will not be required with a forthcoming reimplementation of ASLR
stack randomization.  Moreover, this change was not sufficient to enable
the use of a stack size limit smaller than the stack gap itself.

PR:		260303
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33704
This commit is contained in:
Mark Johnston
2022-01-17 11:42:13 -05:00
parent 3fc21fdd5f
commit 5a8413e779
-3
View File
@@ -672,9 +672,6 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
if (limp->rlim_max < 0)
limp->rlim_max = RLIM_INFINITY;
if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY)
limp->rlim_cur += p->p_vmspace->vm_stkgap;
oldssiz.rlim_cur = 0;
newlim = lim_alloc();
PROC_LOCK(p);