Trying the fsuid/fsgid workaround, I came across another oddity:

$ id -u
1000
$ id -g
1000
$ unshare -r -U -m /bin/bash
# mount -t tmpfs tmpfs /mnt
# chmod 555 /mnt
# ls -ldn /mnt
dr-xr-xr-x 2 0 0 40 Jan 26 14:15 /mnt
# echo $$
2354

In another terminal:

$ sudo nsenter -G 1000 -S 1000 -t 2354 -m
$ ls -ldn /mnt
dr-xr-xr-x 2 1000 1000 40 Jan 26 14:10 /mnt
$ touch /mnt/foo
touch: cannot touch '/mnt/foo': Permission denied

Even though I'm supposed to be root in the context of the user namespace, I 
can't create the file because I'm lacking the write permission on the mount 
directory.
In this case, setting the fsuid/fsgid is not sufficient, I have to join the 
user namespace if I want the permissions to be resolved correctly.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1659087

Title:
  open(2) returns EOVERFLOW within tmpfs+userns

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to