On Wed, Apr 28, 2021 at 12:00:58PM +0100, Dr. David Alan Gilbert (git) wrote: > From: Vivek Goyal > > Extend VhostUserFSSlaveMsg so that slave can ask it to drop CAP_FSETID > before doing I/O on fd. > > In some cases, virtiofsd takes the onus of clearing setuid bit on a file > when WRITE happens. Generally virtiofsd does the WRITE to fd (from guest > memory which is mapped in virtiofsd as well), but if this memory is > unmappable in virtiofsd (like cache window), then virtiofsd asks qemu > to do the I/O instead. > > To retain the capability to drop suid bit on write, qemu needs to > drop the CAP_FSETID as well before write to fd. Extend VhostUserFSSlaveMsg > so that virtiofsd can specify in message if CAP_FSETID needs to be > dropped. > > Signed-off-by: Vivek Goyal > --- > hw/virtio/vhost-user-fs.c | 5 +++++ > include/hw/virtio/vhost-user-fs.h | 6 ++++++ > subprojects/libvhost-user/libvhost-user.h | 6 ++++++ > 3 files changed, 17 insertions(+) Reviewed-by: Stefan Hajnoczi