-
Notifications
You must be signed in to change notification settings - Fork 1.2k
nsenter
failed when only map self gid with newgidmap
#3553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
nsenter
failed when only map own gid with newgidmap
nsenter
failed when only map self gid with newgidmap
From unshare man page:
This means that "deny" in setgroups is required by the kernel for unprivileged users to write to gid_map. See also man user_namespaces to get more details. Note that $ unshare --user --map-root-user -- cat /proc/self/{uid_map,gid_map,setgroups}
0 1000 1
0 1000 1
deny
$ unshare --user --map-current-user -- cat /proc/self/{uid_map,gid_map,setgroups}
1000 1000 1
1000 1000 1
deny
$ unshare --user --map-auto -- cat /proc/self/{uid_map,gid_map,setgroups}
0 100000 65536
0 100000 65536
allow
''' |
Yes, I know unprivileged users need to write "deny" to
For the |
Let's assume user_a has GID
1000
, and an entry in /etc/subgiduser_a:10000:100
.When user run following commands:
nsenter
will returnnsenter: setgroups failed: Operation not permitted
, since/proc/<PID>/setgroups
has been set todeny
.But if user add an extra gid map, then
nsenter
works:Since now
newgidmap
set/proc/<PID>/setgroups
toallow
.This will block user namespace with only 1 self gid map, and will need to add at least an extra gidmap entry to work.
related issue: shadow-maint/shadow#1256
The text was updated successfully, but these errors were encountered: