Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2018 14:17:23 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336340 - stable/11/sys/kern
Message-ID:  <201807161417.w6GEHNId026751@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Mon Jul 16 14:17:23 2018
New Revision: 336340
URL: https://svnweb.freebsd.org/changeset/base/336340

Log:
  MFC r336238:
  
  Round down the location of execpathp to slightly improve copyout speed.
  
  In practice, this moves the padding from below the canary to above
  execpathp has no impact on stack consumption.
  
  Submitted by:		Wuyang-Chung (via github pull request #159)

Modified:
  stable/11/sys/kern/kern_exec.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_exec.c
==============================================================================
--- stable/11/sys/kern/kern_exec.c	Mon Jul 16 13:38:16 2018	(r336339)
+++ stable/11/sys/kern/kern_exec.c	Mon Jul 16 14:17:23 2018	(r336340)
@@ -1507,6 +1507,7 @@ exec_copyout_strings(struct image_params *imgp)
 	 */
 	if (execpath_len != 0) {
 		destp -= execpath_len;
+		destp = rounddown2(destp, sizeof(void *));
 		imgp->execpathp = destp;
 		copyout(imgp->execpath, (void *)destp, execpath_len);
 	}



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