Description of problem: Currently virtiofsd can not run unprivileged. To be precise, an unprivileged user can run it but use of user namespaces is required. Kubevirt/CNV folks want to run virtiofsd unprivileged but can not make use of user namepsaces yet. Opening this bug to allow running virtiofsd unprivileged without requiring usage of user namespaces. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
This is already supported upstream. It'll be fixed with the rebase (BZ 2123070).
Test pkg: virtiofsd-1.5.0-1.el9.x86_64 kernel-5.14.0-226.el9.x86_64(host) kernel-5.14.0-231.el9.x86_64(guest) Test with the following steps: 1. switch to user u3, start virtiofsd with sandbox=none and start a RHEL9.2 VM1. [u3@dell-per440-06 ~]$ /usr/libexec/virtiofsd --socket-path ./sock1 --shared-dir /home/u3/test -d --sandbox none [2023-01-13T08:42:50Z WARN virtiofsd] Use of deprecated flag '-d': Please use the '--log-level debug' option instead [2023-01-13T08:42:50Z WARN virtiofsd::limits] Failure when trying to set the limit to 1000000, the hard limit (8192) of open file descriptors is used instead. [2023-01-13T08:42:50Z INFO virtiofsd] Waiting for vhost-user socket connection... 2. in guest, mount virtiofs. 3. create a file on host. -rw-r--r--. 1 u3 u3 18 Jan 13 04:18 file 4. read the file on guest. --Success 5. write in the shared dir on guest. # echo test > file2 --success 6. try to change the file's owner and group on guest --failed as expected. #chgrp root file chgrp: changing group of 'file': operation not permitted The basic function works for this bug, I will change verified status.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virtiofsd bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2334