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
This commit is contained in:
Brooks Davis 2018-07-13 11:32:27 +00:00
parent 874774c5d4
commit d92da75941

View File

@ -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);
}