Handle incorrect ELF images specifying size for PT_GNU_STACK not being

multiple of page size.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2015-04-23 11:27:21 +00:00
parent 310e931198
commit fe8a824ca6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281883

View File

@ -1060,7 +1060,7 @@ exec_new_vmspace(imgp, sv)
/* Allocate a new stack */
if (imgp->stack_sz != 0) {
ssiz = imgp->stack_sz;
ssiz = trunc_page(imgp->stack_sz);
PROC_LOCK(p);
lim_rlimit(p, RLIMIT_STACK, &rlim_stack);
PROC_UNLOCK(p);