Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Apr 2015 11:27:21 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281883 - head/sys/kern
Message-ID:  <201504231127.t3NBRLQu079502@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504231127.t3NBRLQu079502>