nix/src
Emily a500c90375 libstore: fix sandboxed builds on macOS
The recent fix for CVE-2024-38531 broke the sandbox on macOS
completely. As it’s not practical to use `chroot(2)` on
macOS, the build takes place in the main filesystem tree, and the
world‐unreadable wrapper directory prevents the build from accessing
its `$TMPDIR` at all.

The macOS sandbox probably shouldn’t be treated as any kind of a
security boundary in its current state, but this specific vulnerability
wasn’t possible to exploit on macOS anyway, as creating `set{u,g}id`
binaries is blocked by sandbox policy.

Locking down the build sandbox further may be a good idea in future,
but it already has significant compatibility issues. For now, restore
the previous status quo on macOS.

Thanks to @alois31 for helping me come to a better understanding of
the vulnerability.

Fixes: 1d3696f0fb
Closes: #11002
(cherry picked from commit af2e1142b1)
2024-07-05 15:09:00 +00:00
..
build-remote Pathlocks Implementation for Windows (#10586) 2024-04-22 15:08:10 +00:00
libcmd nix repl: make runNix() isInteractive is true by default 2024-05-30 19:15:37 +02:00
libexpr Merge pull request #10573 from RCoeurjoly/Rename_SearchPath 2024-04-21 17:33:46 +02:00
libexpr-c C API: Add nix_init_apply 2024-04-18 19:13:38 +02:00
libfetchers Handle zip files containing symlinks 2024-05-15 20:07:41 +00:00
libmain init: Add flag to avoid loading configuration 2024-04-20 01:45:04 +02:00
libstore libstore: fix sandboxed builds on macOS 2024-07-05 15:09:00 +00:00
libstore-c init: Add flag to avoid loading configuration 2024-04-20 01:45:04 +02:00
libutil Formatting 2024-06-21 17:16:48 +02:00
libutil-c C API: Use nix_get_string_callback typedef 2024-04-15 12:05:57 +02:00
nix Use proper struct sockpeercred for SO_PEERCRED for OpenBSD 2024-07-03 15:57:13 +00:00
nix-build Merge remote-tracking branch 'origin/master' into finish-value 2024-04-17 16:02:44 +02:00
nix-channel downloadFile(): Remove the "locked" (aka "immutable") flag 2024-04-08 15:56:16 +02:00
nix-collect-garbage Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env Build a minimized Nix with MinGW 2024-04-17 12:26:10 -04:00
nix-instantiate Build a minimized Nix with MinGW 2024-04-17 12:26:10 -04:00
nix-store Build a minimized Nix with MinGW 2024-04-17 12:26:10 -04:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00