1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 21:16:02 +01:00
nix/src
Andrew Marshall 8f439a2c3c libstore: fix port binding in __darwinAllowLocalNetworking sandbox
In d60c3f7f7c, this was changed to close a
hole in the sandbox. Unfortunately, this was too restrictive such that it
made local port binding fail, thus making derivations that needed
`__darwinAllowLocalNetworking` gain nearly nothing, and thus largely
fail (as the primary use for it is to enable port binding).

This unfortunately does mean that a sandboxed build process can, in
coordination with an actor outside the sandbox, escape the sandbox by
binding a port and connecting to it externally to send data. I do not
see a way around this with my experimentation and understanding of the
(quite undocumented) macOS sandbox profile API. Notably it seems not
possible to use the sandbox to do any of:

- Restrict the remote IP of inbound network requests
- Restrict the address being bound to

As such, the `(local ip "*:*")` here appears to be functionally no
different than `(local ip "localhost:*")` (however it *should* be
different than removing the filter entirely, as that would make it also
apply to non-IP networking). Doing `(allow network-inbound (require-all
(local ip "localhost:*") (remote ip "localhost:*")))` causes listening
to fail.

Note that `network-inbound` implies `network-bind`.

(cherry picked from commit 00f6db36fd)
2024-08-17 03:17:43 +00:00
..
build-remote Use the new StoreReference in Machine 2024-05-22 09:20:15 -04:00
libcmd Eval cache: fix cache regressions 2024-07-26 15:59:36 +00:00
libexpr Eval cache: fix cache regressions 2024-07-26 15:59:36 +00:00
libexpr-c clarify not on nix_value_force (#10842) 2024-06-04 07:41:04 +00:00
libfetchers Show when we're unpacking an archive into the Git cache 2024-07-29 13:02:58 +00:00
libmain Remove 100s of CPU time (10%) from build times (1465s -> 1302s) 2024-05-31 13:00:09 +02:00
libstore libstore: fix port binding in __darwinAllowLocalNetworking sandbox 2024-08-17 03:17:43 +00:00
libstore-c add empty line to documentation comments after @brief field (#10800) 2024-05-28 23:05:40 +00:00
libutil add call to checkInterrupt in a bunch of places 2024-07-17 16:02:07 +00:00
libutil-c C API: Use nix_get_string_callback typedef 2024-04-15 12:05:57 +02:00
nix Clean up cache for all commands 2024-07-26 15:59:36 +00:00
nix-build fix: remove usage of XDG_RUNTIME_DIR for TMP 2024-06-10 13:40:45 +00:00
nix-channel downloadFile(): Remove the "locked" (aka "immutable") flag 2024-04-08 15:56:16 +02:00
nix-collect-garbage inline the usage of nix::readDirectory 2024-05-12 17:42:18 +05:30
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env Remove 100s of CPU time (10%) from build times (1465s -> 1302s) 2024-05-31 13:00:09 +02:00
nix-instantiate Build a minimized Nix with MinGW 2024-04-17 12:26:10 -04:00
nix-store Factor our connection code for worker proto like serve proto 2024-05-27 00:43:46 -04:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00