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);
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to