From f519ddf7330f6dd05c880f0135336a8e9d9ca026 Mon Sep 17 00:00:00 2001 From: Reepca Russelstein Date: Thu, 6 Nov 2025 13:50:34 -0600 Subject: daemon: Allow ADDR_NO_RANDOMIZE to be omitted if `--allow-aslr'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Modified-by: Ludovic Courtès Merges: #4616 --- build-aux/test-env.in | 1 + 1 file changed, 1 insertion(+) (limited to 'build-aux') 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 "@abs_top_builddir@/pre-inst-env" \ "@abs_top_builddir@/guix-daemon" \ $extra_options \ + --allow-aslr \ --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL" & daemon_pid=$! -- cgit v1.2.3