incus-mirror/internal/linux
Alvaro Leiva Geisse 5ae0eb29b6
internal/linux: detect initial user namespace by inode
The current uid_map heuristic treats a private user namespace with an
identity uid_map as the initial user namespace. systemd 260 can create
that shape with PrivateUsers=full, causing callers to believe they can
perform initial-namespace-only operations.

Use /proc/self/ns/user's inode instead and compare it with the kernel's
PROC_USER_INIT_INO value. This detects the initial user namespace
directly instead of inferring it from the uid_map layout.

Related: https://github.com/containers/crun/issues/2150
Signed-off-by: Alvaro Leiva Geisse <aleivag@gmail.com>
2026-07-29 18:34:25 -04:00
..
acl.go incusd/linux: Add GrantPosixACLUser 2026-07-11 15:05:08 -04:00
cgo.go internal/linux: Move cgo.go 2023-09-08 10:36:01 -04:00
discard.go internal/linux: Log deferred errors with WarnOnError 2026-06-06 19:14:38 -04:00
error.go internal/linux: Return error last from GetErrno (revive:error-return) 2026-05-26 18:08:25 -04:00
filesystem.go internal/linux: Log deferred errors with WarnOnError 2026-06-06 19:14:38 -04:00
ioctls.go internal/linux: Add IoctlBlkZname 2025-11-19 10:10:03 -05:00
kernel.go global: Use strings.Builder for string concatenation in loops 2026-05-27 03:39:07 -04:00
memfd.go Rewrite Go import path to v7 2026-05-02 01:18:25 +02:00
memory.go internal/linux: Log deferred errors with WarnOnError 2026-06-06 19:14:38 -04:00
netlink.go internal/linux: Add NetlinkInterfaces 2024-11-12 08:52:01 -05:00
poll.go internal/linux: Add missing doc comments on exported symbols (revive:exported) 2026-05-26 18:08:28 -04:00
pty.go internal/linux: Rename devpts_fd parameter (revive:var-naming) 2026-05-26 18:08:26 -04:00
socket_linux_cgo.go internal/linux: Add missing doc comments on exported symbols (revive:exported) 2026-05-26 18:08:28 -04:00
socket_linux_notcgo.go shared/linux: Move to internal 2023-09-07 15:28:24 -04:00
socket.go incusd/linux: Add ListenUnix helper 2026-06-12 18:15:51 -04:00
storage.go Rewrite Go import path to v7 2026-05-02 01:18:25 +02:00
systemd.go internal/linux: Move systemd functions from incusd/util 2023-09-29 16:30:02 -04:00
ucred.go internal/linux: Move GetUcred 2023-09-29 16:30:05 -04:00
userns.go internal/linux: detect initial user namespace by inode 2026-07-29 18:34:25 -04:00