aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/linux32/linux32_sysvec.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-12-09 19:18:05 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2019-12-09 19:18:05 +0000
commit23a5b4ed659d98e52a5d1756b2e609123f5a33d7 (patch)
treef34b4aad13ee6a784b9420d1f13e65b003516224 /sys/amd64/linux32/linux32_sysvec.c
parentbc053cafcaa284323172c45995fff6d26b9189ab (diff)
downloadsrc-23a5b4ed659d98e52a5d1756b2e609123f5a33d7.tar.gz
src-23a5b4ed659d98e52a5d1756b2e609123f5a33d7.zip
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.
Notes
Notes: svn path=/head/; revision=355569
Diffstat (limited to 'sys/amd64/linux32/linux32_sysvec.c')
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 58edea923427..9472a9762f01 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -741,7 +741,7 @@ linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base)
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, uintptr_t *stack_base)
/* 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, uintptr_t *stack_base)
/* 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, uintptr_t *stack_base)
* 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;