svn commit: r355569 - head/sys/amd64/linux32

John Baldwin jhb at FreeBSD.org
Mon Dec 9 19:18:06 UTC 2019


Author: jhb
Date: Mon Dec  9 19:18:05 2019
New Revision: 355569
URL: https://svnweb.freebsd.org/changeset/base/355569

Log:
  Use 4 byte stack alignment instead of 8 byte.
  
  This was an old bug prior to r355373 and mostly harmless as it would
  waste at most a handful of bytes on the stack.

Modified:
  head/sys/amd64/linux32/linux32_sysvec.c

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Mon Dec  9 19:17:56 2019	(r355568)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Mon Dec  9 19:18:05 2019	(r355569)
@@ -741,7 +741,7 @@ linux_copyout_strings(struct image_params *imgp, uintp
 
 	if (execpath_len != 0) {
 		destp -= execpath_len;
-		destp = rounddown2(destp, sizeof(void *));
+		destp = rounddown2(destp, sizeof(uint32_t));
 		imgp->execpathp = destp;
 		error = copyout(imgp->execpath, (void *)destp, execpath_len);
 		if (error != 0)
@@ -750,7 +750,7 @@ linux_copyout_strings(struct image_params *imgp, uintp
 
 	/* Prepare the canary for SSP. */
 	arc4rand(canary, sizeof(canary), 0);
-	destp -= roundup(sizeof(canary), sizeof(void *));
+	destp -= roundup(sizeof(canary), sizeof(uint32_t));
 	imgp->canary = destp;
 	error = copyout(canary, (void *)destp, sizeof(canary));
 	if (error != 0)
@@ -758,7 +758,7 @@ linux_copyout_strings(struct image_params *imgp, uintp
 
 	/* Allocate room for the argument and environment strings. */
 	destp -= ARG_MAX - imgp->args->stringspace;
-	destp = rounddown2(destp, sizeof(void *));
+	destp = rounddown2(destp, sizeof(uint32_t));
 	ustringp = destp;
 
 	if (imgp->auxargs) {
@@ -767,7 +767,7 @@ linux_copyout_strings(struct image_params *imgp, uintp
 		 * array.  It has LINUX_AT_COUNT entries.
 		 */
 		destp -= LINUX_AT_COUNT * sizeof(Elf32_Auxinfo);
-		destp = rounddown2(destp, sizeof(void *));
+		destp = rounddown2(destp, sizeof(uint32_t));
 	}
 
 	vectp = (uint32_t *)destp;


More information about the svn-src-all mailing list