aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-07-13 11:32:27 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-07-13 11:32:27 +0000
commitd92da7594102739c7786552c53e07e4ce3367f39 (patch)
tree46d89bb703a9d86da91a75ec823bbcc87fbac67c /sys/kern/kern_exec.c
parent874774c5d486aefc80e345b1f12ec3c9f1628fd5 (diff)
downloadsrc-d92da7594102739c7786552c53e07e4ce3367f39.tar.gz
src-d92da7594102739c7786552c53e07e4ce3367f39.zip
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) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=336238
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index e6b3782d93dd..99b5016a41d7 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1512,6 +1512,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);
}