[lxc-devel] mounting mqueue in a user namespace

Serge Hallyn serge.hallyn at ubuntu.com
Fri Mar 11 00:18:32 UTC 2016


Quoting Thomas Tanaka (thomas.tanaka at oracle.com):
> Hi,
> 
> This question might not be specific to lxc/lxd but containers in
> general, I hope that is okay.
> I have a process created using clone with the following flags
> (CLONE_NEWNS|CLONE_NEWIPC|CLONE_NEWUSER).
> The process then try to mount the mqueue filesystem (mount -t mqueue
> mqueue /dev/mqueue).
> However, the mounted mqueue fs has inode->i_uid = 0, instead of our
> ns uid e.g 10000. Is this expected ?
> For other e.g tmpfs the inode->i_uid is properly set to our ns uid.

Doesn't happen for me.  As simplest example, if I

lxc-usernsexec
# lxc-unshare -s 'IPC|MOUNT' bash
## mount -t mqueue mqueue /mnt
## touch /mnt; ls -ld /mnt; ls -l /mnt

I see everything owned by my namespaced root user, 'root' in my shell.


More information about the lxc-devel mailing list