CLONE_CLEAR_NNP (Re: [PATCH v2 1/4] userns: introduce capability bounding set for user namespaces)

Andy Lutomirski luto at amacapital.net
Tue Dec 1 22:17:43 UTC 2026


On Tue, Dec 1, 2026 at 3:52 AM Christian Brauner <brauner at kernel.org> wrote:
>
> On Mon, Nov 30, 2026 at 11:31:23AM -0800, Andy Lutomirski wrote:
> > We add a new LSM hook clear_nnp.  The logic that one may only use it
> > when unsharing userns goes outside LSM (because there is nothing in
> > the hook that indicates that userns is being unshared, so it can't go
> > in commoncap).  Apparmor implements it by only allowing unconfined
> > tasks to do it (and apparmor devs are welcome to change this policy if
> > it becomes useful).  selinux adds an actual new policy
> > PROCESS2__CLEAR_NNP.
>
> Sounds decent. It's fine to add the hooks later.
> Send that soon if you can. That doesn't need to hold up the other stuff.

It's sitting here, with apparmor and selinux hooks and a test case
(AI-written) that passes:

https://github.com/amluto/linux/tree/clone_nnp

(The code is drafted partially by AI and substantially cleaned up by me.)

I'll send it out later today or tomorrow, but you're welcome to
comment even before I manage to send it.



More information about the Linux-security-module-archive mailing list