[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/08: daemon: Ensure proper alignment on the stack.
From: |
Efraim Flashner |
Subject: |
07/08: daemon: Ensure proper alignment on the stack. |
Date: |
Mon, 20 Feb 2017 06:05:19 -0500 (EST) |
efraim pushed a commit to branch core-updates
in repository guix.
commit 77e16733197b8950f6b665be1f69375cb2a7155f
Author: Efraim Flashner <address@hidden>
Date: Tue Feb 14 21:48:30 2017 +0200
daemon: Ensure proper alignment on the stack.
* nix/libstore/build.cc (startBuilder): When calling 'clone', increase
the step to 16 and ensure it aligns properly on the stack.
---
nix/libstore/build.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index cebc404..9b7bb53 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -26,6 +26,7 @@
#include <errno.h>
#include <stdio.h>
#include <cstring>
+#include <stdint.h>
#include <pwd.h>
#include <grp.h>
@@ -2008,7 +2009,11 @@ void DerivationGoal::startBuilder()
char stack[32 * 1024];
int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS |
SIGCHLD;
if (!fixedOutput) flags |= CLONE_NEWNET;
- pid = clone(childEntry, stack + sizeof(stack) - 8, flags, this);
+
+ /* Ensure proper alignment on the stack. On aarch64, it has to be 16
+ bytes. */
+ pid = clone(childEntry, (char *)(((uintptr_t)stack + 16) & ~0xf),
+ flags, this);
if (pid == -1)
throw SysError("cloning builder process");
} else
- branch core-updates updated (8f8f250 -> 3b88f37), Efraim Flashner, 2017/02/20
- 03/08: gnu: coreutils: Don't run tests in parallel., Efraim Flashner, 2017/02/20
- 01/08: gnu: libpng: Update source urls., Efraim Flashner, 2017/02/20
- 04/08: gnu: bash: Update to patch level 12., Efraim Flashner, 2017/02/20
- 06/08: gnu: %bootstrap-coreutils&co: Patch egrep/fgrep to work regardless of $PATH., Efraim Flashner, 2017/02/20
- 05/08: Merge remote-tracking branch 'origin/master' into core-updates, Efraim Flashner, 2017/02/20
- 02/08: gnu: libpng: Update to 1.6.28., Efraim Flashner, 2017/02/20
- 08/08: gnu: Add bootstrap-binaries for 'aarch64-linux'., Efraim Flashner, 2017/02/20
- 07/08: daemon: Ensure proper alignment on the stack.,
Efraim Flashner <=