r-vdp
1ac3c5dc99
nixos/shadow: use file capabilities for newuidmap/newgidmap
...
Writing a multi-line /proc/<pid>/[ug]id_map only requires
CAP_SETUID/CAP_SETGID over the parent user namespace, not full root.
shadow's own --with-fcaps install mode (70971457b761) sets exactly
cap_setuid+ep / cap_setgid+ep, and Arch, Fedora and Debian have shipped
these binaries with file capabilities instead of setuid for years.
The setuid variant already drops to the same single capability before
the uid_map write (see lib/idmapping.c), so the privilege at the point
attacker-controlled data reaches the kernel is unchanged. The reduction
is in the startup window: with file capabilities the process never has
euid 0 and never holds the full capability set during NSS lookups,
/etc/subuid parsing and /proc/<pid> opening.
The only functional difference is that mapping host uid 0 into a child
namespace additionally needs CAP_SETFCAP, which the setuid path got
implicitly. NixOS never puts uid 0 into auto-allocated subuid ranges,
and granting it manually is a deliberate root-equivalent configuration;
the release notes document the override for that case.
nixosTests.{shadow,podman,docker-rootless} pass; the latter two
exercise newuidmap/newgidmap via rootless containers.
Supersedes #461172 .
Co-authored-by: Rasheeq Azad <rasheeqhere@gmail.com >
2026-06-01 00:18:28 +03:00
..
2026-01-15 16:07:55 +01:00
2026-05-19 11:50:38 -04:00
2025-12-02 16:34:27 +01:00
2026-03-14 16:43:46 +01:00
2026-05-22 15:29:27 +03:00
2026-03-13 20:20:19 +00:00
2026-01-30 06:24:02 +00:00
2025-11-03 16:41:17 -05:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-04-02 23:22:46 +03:00
2024-12-10 20:26:33 +01:00
2024-07-22 07:47:00 +08:00
2024-11-18 16:47:56 +01:00
2026-01-15 16:07:55 +01:00
2026-04-23 09:33:52 +02:00
2024-12-10 20:26:33 +01:00
2024-12-19 10:06:55 +01:00
2024-12-10 20:26:33 +01:00
2025-12-09 21:05:56 +01:00
2024-12-10 20:26:33 +01:00
2026-05-01 20:39:14 -04:00
2026-03-30 20:24:52 +02:00
2024-12-10 20:26:33 +01:00
2026-05-13 23:16:54 +03:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-02-06 14:29:16 -08:00
2026-02-27 10:56:33 +01:00
2025-07-24 13:55:40 +02:00
2024-12-10 20:26:33 +01:00
2025-08-21 22:31:56 +03:00
2025-05-23 13:02:18 -06:00
2026-03-01 13:43:54 +08:00
2025-03-31 16:25:04 +03:30
2025-10-26 00:06:21 +02:00
2024-10-19 21:23:55 -04:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-03-01 14:00:36 +08:00
2026-01-01 20:14:16 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-03-13 16:53:28 +01:00
2024-12-10 20:26:33 +01:00
2025-12-26 14:21:49 +01:00
2024-12-10 20:26:33 +01:00
2025-10-22 00:13:25 +02:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-07-24 13:55:40 +02:00
2026-03-01 14:00:36 +08:00
2026-01-15 16:07:55 +01:00
2026-04-29 17:39:44 -06:00
2025-04-19 00:13:02 +02:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-01-15 16:07:55 +01:00
2025-09-01 09:58:42 +08:00
2026-05-24 17:01:12 +02:00
2026-05-27 19:33:33 +02:00
2024-12-10 20:26:33 +01:00
2026-03-13 16:53:28 +01:00
2025-02-18 09:53:01 +01:00
2025-10-03 21:18:33 -03:00
2026-02-26 07:45:43 -08:00
2026-03-13 16:53:28 +01:00
2026-03-13 16:53:28 +01:00
2025-08-21 22:31:56 +03:00
2025-05-28 13:27:36 +02:00
2025-04-01 20:10:43 +02:00
2026-02-06 22:01:39 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-01-15 16:07:55 +01:00
2026-04-11 22:07:56 -04:00
2024-12-10 20:26:33 +01:00
2026-01-26 14:02:57 +01:00
2024-11-18 16:47:56 +01:00
2024-08-18 01:18:23 +05:30
2024-10-08 11:38:55 -07:00
2025-04-11 12:21:35 +00:00
2024-11-30 17:19:13 -08:00
2024-12-10 20:26:33 +01:00
2025-05-04 20:46:53 -07:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-11-23 22:34:04 +01:00
2025-05-11 16:53:44 +00:00
2025-10-18 12:01:19 +03:00
2025-09-22 02:46:54 +02:00
2024-12-10 20:26:33 +01:00
2025-08-25 12:55:11 -04:00
2026-01-15 16:07:55 +01:00
2026-01-15 16:07:55 +01:00
2026-04-13 14:22:11 +02:00
2026-05-25 23:45:07 +02:00
2024-08-09 23:31:24 +08:00
2025-02-18 15:02:34 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-02-26 22:24:17 +01:00
2025-02-20 18:49:45 +05:30
2024-12-10 20:26:33 +01:00
2025-07-15 20:41:31 +02:00
2024-12-10 20:26:33 +01:00
2025-04-01 20:10:43 +02:00
2025-08-25 12:55:11 -04:00
2024-12-10 20:26:33 +01:00
2026-04-03 21:32:52 +05:30
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-04-28 05:29:17 +07:00
2024-12-10 20:26:33 +01:00
2026-01-22 18:37:56 -03:00
2026-05-10 20:04:55 +02:00
2025-10-29 20:50:20 +01:00
2026-03-13 16:53:28 +01:00
2026-01-15 16:07:55 +01:00
2024-12-10 20:26:33 +01:00
2026-03-03 00:59:35 +01:00
2024-12-10 20:26:33 +01:00
2026-01-12 15:02:35 +01:00
2026-04-23 16:06:25 -04:00
2024-12-10 20:26:33 +01:00
2024-11-18 11:33:43 -05:00
2024-12-10 20:26:33 +01:00
2025-07-24 13:55:40 +02:00
2026-01-22 00:00:18 +01:00
2025-08-10 10:19:20 +03:00
2025-10-24 06:30:16 +03:00
2025-07-24 13:52:31 +02:00
2024-12-10 20:26:33 +01:00
2025-10-10 01:56:08 +02:00
2025-08-20 17:54:38 +02:00
2026-01-15 16:07:55 +01:00
2024-09-18 23:20:57 +02:00
2024-12-10 20:26:33 +01:00
2025-04-01 20:10:43 +02:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-05-12 16:04:19 +03:00
2024-12-10 20:26:33 +01:00
2025-04-19 19:45:05 +02:00
2025-10-16 21:03:35 +00:00
2025-08-25 12:55:11 -04:00
2025-07-24 13:55:40 +02:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-06-01 00:18:28 +03:00
2024-12-10 20:26:33 +01:00
2024-06-03 07:53:21 +08:00
2025-09-21 18:47:05 +02:00
2024-12-10 20:26:33 +01:00
2025-11-02 20:16:11 -05:00
2024-12-10 20:26:33 +01:00
2026-01-25 22:58:40 +01:00
2026-05-22 15:28:21 +01:00
2026-05-28 16:05:14 +02:00
2025-03-21 15:32:45 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2024-11-18 16:47:56 +01:00
2025-12-20 10:22:30 +08:00
2026-03-29 17:36:37 +02:00
2026-03-13 16:53:28 +01:00
2024-05-22 14:55:16 +09:00
2025-12-06 07:02:22 +00:00
2024-11-18 16:47:56 +01:00
2025-11-02 20:16:11 -05:00
2026-03-27 19:31:06 +01:00
2025-06-02 16:07:07 +02:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-09-18 16:22:46 +00:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2025-06-02 02:48:30 +02:00
2025-09-18 16:22:46 +00:00
2024-12-10 20:26:33 +01:00
2024-12-10 20:26:33 +01:00
2026-03-31 18:33:50 +08:00
2026-04-29 21:44:14 +01:00
2025-03-07 19:34:27 +01:00
2025-10-05 10:50:41 +02:00
2025-12-11 23:54:41 +01:00
2026-03-13 16:53:28 +01:00
2026-01-15 16:07:55 +01:00
2025-04-01 20:10:43 +02:00
2025-08-08 10:09:50 +02:00
2026-01-15 16:07:55 +01:00
2024-12-10 20:26:33 +01:00
2026-01-05 00:36:45 +00:00
2024-12-10 20:26:33 +01:00
2025-09-04 00:44:52 +02:00
2026-01-15 16:07:55 +01:00
2024-12-10 20:26:33 +01:00
2025-11-05 06:22:54 +00:00
2025-03-26 22:08:23 +02:00