Open smcv opened 7 years ago
With just hidepid=2 the error becomes: setting up uid map: No such file or directory
so it happens due disappeared PID directory, there is a workaround to use gid= mount option to allow members of the group to see all processes, i.e. with hidepid=2,gid=1000 mount options members of group 1000 can use bwrap --unshare-user
Maybe it would be a good idea to make the --unshare-user-try
flag check if hidepid=1
or hidepid=2
is in use as a work around for this so things that use user namespaces won't break if the user is using hidepid.
I've received this bug report in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867847. The rest of this issue report is quoting Guilhem Moulin.
I noticed that bubblewrap refuses to create a new user namespace when the procfs is mounted (outside the container) with hidepid≥1.
It doesn't help to also create a new PID namespace:
Not sure if that's the intended behavior or not. (In any case, it's not documented.) But when a new PID namespace is also created and /proc is remounted, couldn't bwrap set hidepid=0 in the container?
Moreover, although the children do terminate, the bwrap processes do not (and sending SIGTERM is not enough to terminate them):
And the leftover container's effective and saved set UIds are still 0: