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 /doc | |
| 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 'doc')
| -rw-r--r-- | doc/guix.texi | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 51bab399b85..bb415f2cc59 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -1781,6 +1781,21 @@ user namespaces is missing (@pxref{Build Environment Setup}). Use at | |||
| 1781 | your own risk! | 1781 | your own risk! |
| 1782 | @end quotation | 1782 | @end quotation |
| 1783 | 1783 | ||
| 1784 | @cindex ASLR (address space layout randomization), for builds | ||
| 1785 | @cindex address space layout randomization (ASLR), for builds | ||
| 1786 | @cindex Docker, running @command{guix-daemon} | ||
| 1787 | @cindex @command{guix-daemon}, running under Docker | ||
| 1788 | @item --allow-aslr | ||
| 1789 | Allow builds to start even if @acronym{ASLR, Address Space Layout | ||
| 1790 | Randomization} cannot be disabled on Linux systems. This is normally | ||
| 1791 | done so as to increase reproducibility, but some environments, such as | ||
| 1792 | those affected by Docker's default seccomp policy, don't permit | ||
| 1793 | disabling ASLR. Passing this option will allow builds to start with | ||
| 1794 | reduced reproducibility regardless. | ||
| 1795 | |||
| 1796 | Note that passing this option doesn't ensure that ASLR is enabled, it | ||
| 1797 | only allows builds to start even when disabling it is blocked. | ||
| 1798 | |||
| 1784 | @item --isolate-host-loopback | 1799 | @item --isolate-host-loopback |
| 1785 | Prevent fixed-output chroot builds from accessing the host loopback. | 1800 | Prevent fixed-output chroot builds from accessing the host loopback. |
| 1786 | When this is used, fixed-output builds will have their own loopback | 1801 | When this is used, fixed-output builds will have their own loopback |
