Author: kib
Date: Thu Apr 23 11:27:21 2015
New Revision: 281883
URL: https://svnweb.freebsd.org/changeset/base/281883

Log:
  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

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c   Thu Apr 23 08:41:50 2015        (r281882)
+++ head/sys/kern/kern_exec.c   Thu Apr 23 11:27:21 2015        (r281883)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to