From b80f40287ee33f091d2f02c13c2cad8a5576d1e5 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 5 Aug 2019 19:16:33 +0000 Subject: [PATCH] Fix mis-merge Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index e129f9238f18..e148e0b1f20d 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1128,7 +1128,9 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) } else { ssiz = maxssiz; } - imgp->eff_stack_sz = ssiz; + imgp->eff_stack_sz = lim_cur(curthread, RLIMIT_STACK); + if (ssiz < imgp->eff_stack_sz) + imgp->eff_stack_sz = ssiz; stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot :