1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-10 16:50:43 +02:00
guix/nix/libstore
Reepca Russelstein b79100ef61
daemon: Conditionally disable seccomp filter on ‘socketcall’ systems.
glibc currently will insist on using 'socketcall' on i686-linux unless built
with '--enable-kernel=4.3.0' or above, even on systems that have dedicated
system calls available for all the socket-related functionality.  This
behavior breaks the assumption that socketcall can be safely blocked without
impacting functionality in slirp4netns, rendering the seccomp filter unusable
with those glibcs.

This change makes the slirp4netns seccomp filter opt-in on systems with a
'socketcall' system call.  It can either be opted-into at compile-time or at
runtime using the NO_SOCKETCALL_LIBC preprocessor define or the
GUIX_FORCE_SECCOMP environment variable, respectively.

The seccomp filter being disabled on these systems means that it is possible
for a compromised slirp4netns to access abstract unix domain sockets in the
root network namespace.  It does not affect any of the other mechanisms used
to isolate slirp4netns (e.g. chroot, namespaces, etc).

Fixes guix/guix#808.

* nix/libstore/build.cc (spawnSlirp4netns) [__NR_socketcall]: Do not add
seccomp filter, unless ‘GUIX_FORCE_SECCOMP’ is set.

Change-Id: Ibfe8becc9431f5aff11a21f06858b20496f9cb4a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-30 19:36:41 +02:00
..
.gitignore
build.cc daemon: Conditionally disable seccomp filter on ‘socketcall’ systems. 2025-06-30 19:36:41 +02:00
builtins.cc
builtins.hh
derivations.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
derivations.hh
gc.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
globals.cc daemon: Use slirp4netns to provide networking to fixed-output derivations. 2025-06-24 10:07:57 -04:00
globals.hh daemon: Use slirp4netns to provide networking to fixed-output derivations. 2025-06-24 10:07:57 -04:00
local-store.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
local-store.hh
misc.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
misc.hh
optimise-store.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
pathlocks.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
pathlocks.hh
references.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
references.hh
sqlite.cc
sqlite.hh
store-api.cc daemon: Remove ‘foreach’ and ‘foreach_reverse’ 2025-06-09 22:05:13 +02:00
store-api.hh daemon: Fix build failure with gcc@15. 2025-06-01 16:01:03 +02:00
worker-protocol.hh daemon: Implement ‘substitute-urls’ RPC. 2023-12-11 23:18:53 +01:00