Files
containerd/pkg
Andrew Halaney 59cc4cc49d pkg/sys: Let more environments create user namespace as the initial user
By restoring the effective capabilities of the thread after setresuid()
we can both:

    1. Use the go runtime to setup the uid_map now that we have the
       capabilities to do so in the thread again
    2. Enable this on distro's which have restrictions around
       unprivileged user namespace creation and usage (since the thread
       is now privileged)

Let's do it. See [0] for more details on this topic. Unlike
unix::Setresuid()[1], which mimics the glibc implementation and acts on all
threads in the process, unix::Cap{s,g}et() are thread local[2] only as we
want, so we can use that directly.

[0]: https://github.com/containerd/containerd/pull/12317#discussion_r2686960671
[1]: e2fef50def/src/syscall/syscall_linux.go (L1217)
[2]: 6fb913b30f/unix/zsyscall_linux.go (L524)
Signed-off-by: Andrew Halaney <ahalaney@netflix.com>
2026-01-14 09:04:32 -06:00
..
2023-02-10 10:23:59 -07:00
2026-01-06 10:52:49 -08:00
2024-08-26 23:35:24 -07:00
2025-04-23 18:03:29 -07:00
2024-12-23 23:14:49 -07:00
2024-01-25 22:18:45 -08:00
2024-10-26 14:18:53 +02:00
2023-09-22 07:53:23 -07:00
2024-01-25 22:18:45 -08:00
2024-12-23 23:14:49 -07:00
2024-05-02 11:03:00 -07:00