Re: [PATCH linux 0/3] [PATCH] userns: add sysctl "kernel.userns_group_range"
From: Eric W. Biederman
Date: Thu Jun 01 2023 - 20:07:01 EST
~akihirosuda <akihirosuda@xxxxxxxxx> writes:
> This sysctl limits groups who can create a new userns without
> CAP_SYS_ADMIN in the current userns, so as to mitigate potential kernel
> vulnerabilities around userns.
>
> The sysctl value format is same as "net.ipv4.ping_group_range".
>
> To disable creating new unprivileged userns, set the sysctl value to "1
> 0" in the initial userns.
>
> To allow everyone to create new userns, set the sysctl value to "0
> 4294967294". This is the default value.
>
> This sysctl replaces "kernel.unprivileged_userns_clone" that is found in
> Ubuntu [1] and Debian GNU/Linux.
>
> Link: https://git.launchpad.net/~ubuntu-
> kernel/ubuntu/+source/linux/+git/jammy/commit?id=3422764 [1]
>
> Signed-off-by: Akihiro Suda <akihiro.suda.cz@xxxxxxxxxxxxx>
How does this functionally differ from what already exists
user.max_user_namespaces?
Given that setns exists I don't see limiting creation of user namespaces
by group being meaningful, if your goal is to reduce the attack surface
of the kernel to mitigate potential kernel vulnerabilities.
How does this functionality interact with the use of setgroups in a user
namespace?
What is the value of a group_range inside of a newly created user
namespace? How does that work to maintain the policy you are trying to
implement?
Eric