diff options
| author | Reepca Russelstein <reepca@russelstein.xyz> | 2025-11-06 13:50:34 -0600 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-27 18:25:16 +0200 |
| commit | f519ddf7330f6dd05c880f0135336a8e9d9ca026 (patch) | |
| tree | 5a53de837beff50f72d4c1f76931ed943bcf390e /build-aux | |
| parent | 4ac91ee39c0980c523455ad5329f45f05961b44a (diff) | |
daemon: Allow ADDR_NO_RANDOMIZE to be omitted if `--allow-aslr'.
Docker's default seccomp filter prevents use of the ADDR_NO_RANDOMIZE flag
with the personality system call. It causes personality to return EPERM. In
general, we assume that any result other than the only documented one, EINVAL,
is caused by seccomp. If we detect that ADDR_NO_RANDOMIZE is blocked, and the
--allow-aslr option was passed, we simply don't use it.
This allows guix-daemon to continue to work even in these containers, without
any implicit weakening of reproducibility.
Since it is presumably desirable to be able to build guix itself in such an
environment, also pass --allow-aslr to guix-daemon in test-env.
* nix/libstore/globals.hh (Settings::allowASLR): new field.
* nix/nix-daemon/guix-daemon.cc (options): add --allow-aslr option.
(parse_opt): use it to set Settings::allowASLR.
* nix/libstore/build.cc (DerivationGoal::startBuilder): detect when
ADDR_NO_RANDOMIZE is blocked and --allow-aslr is passed and don't use it in
that case.
* doc/guix.texi: document --allow-aslr in "Invoking guix-daemon".
* build-aux/test-env.in: always pass --allow-aslr.
Fixes: guix/guix#3917
Change-Id: I51c5899a9559e161f9e107c2e6a36df395ab3134
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
Merges: #4616
Diffstat (limited to 'build-aux')
| -rw-r--r-- | build-aux/test-env.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/build-aux/test-env.in b/build-aux/test-env.in index ade0190f08b..7f46ec9fca2 100644 --- a/build-aux/test-env.in +++ b/build-aux/test-env.in | |||
| @@ -120,6 +120,7 @@ running 'guix-daemon $extra_options'" >&2 | |||
| 120 | "@abs_top_builddir@/pre-inst-env" \ | 120 | "@abs_top_builddir@/pre-inst-env" \ |
| 121 | "@abs_top_builddir@/guix-daemon" \ | 121 | "@abs_top_builddir@/guix-daemon" \ |
| 122 | $extra_options \ | 122 | $extra_options \ |
| 123 | --allow-aslr \ | ||
| 123 | --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL" & | 124 | --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL" & |
| 124 | 125 | ||
| 125 | daemon_pid=$! | 126 | daemon_pid=$! |
