Re: [PATCH 0/8] userns: per-namespace capability bounding set and opt-in netns loopback
From: Christian Brauner
Date: Thu Nov 19 2026 - 09:08:55 EST
On Thu, Nov 19, 2026 at 10:47:13AM +0000, Hallgrimur H. Gunnarsson wrote:
> On Wed, Nov 18, 2026 at 03:43:03PM +0100, Mickaël Salaün wrote:
> > Hallgrimur, could you please explain why your use case would not work
> > with Landlock? The capability split or new clone flags would be
> > complementary of course.
>
> Apologies for the late reply.
>
> Landlock's capability restrictions work well for self-sandboxing
> applications and launchers. The main gap for our use case is setting a
> host-wide default for unprivileged user namespaces while still permitting
> exceptions. Because Landlock restricts all capability use (not just
> capabilities acquired via user namespaces) and its domains are strictly
> irrevocable, PID 1 cannot apply a default policy at boot without
> locking out privileged services, file-capability helpers, and authorized
> workloads. Using Landlock here would require explicit opt-in enforcement
> at every unprivileged transition boundary (SSH, container/job launchers,
> etc.), where missing any entrypoint leaves unprivileged user namespaces
> unrestricted.
>
> In v1 we had the global sysctl to tackle this. In v2 (based on Christian
> and Andy's feedback), we combine per-cred cap_userns with per-userns
> cap_bset), and PID 1 or a service manager can lower the default userns
Plus, this is useful and improves security in general without having to
use any LSM framework.