Issue in Rust virtiofsd - unable to access files
When using virtiofsd with Posix ACLs and supplementary groups, the user is unable to access files that could be accessed normally on the host system.
- Create a user with UID 500 on both the host and guest systems
- Create a group with UID 99 on both the host and guest systems
- Add the user to the group in /etc/group on both the host and guest systems
- mkdir -p /tmp/share/test
- setfacl -m g:99:rwx /tmp/share/test
- chmod 770 /tmp/share/test
- Start virtiofsd:
virtiofsd-1.13.0 --socket-path=SOCKET --shared-dir=/tmp/share --xattr --posix-acl --sandbox none - Start QEMU and try to create a file as the UID 500 user on the guest:
touch /mnt/test/file - This results in an error:
touch: cannot touch '/net/test/file': Permission denied
We were able to track this down to a permission denied error on the host side. When the virtiofsd process sets its UID to 500, the supplementary groups are not set on the host side.
The attached patch resolves the problem but requires that there is no sandbox. Can someone please look at this and suggest a patch that would fully resolve this issue?