On Wed, Apr 28, 2021 at 12:01:00PM +0100, Dr. David Alan Gilbert (git) wrote: > From: Vivek Goyal > > If qemu guest asked to drop CAP_FSETID upon write, send that info > to qemu in SLAVE_FS_IO message so that qemu can drop capability > before WRITE. This is to make sure that any setuid bit is killed > on fd (if there is one set). > > Signed-off-by: Vivek Goyal I'm not sure if the QEMU FSETID patches make sense. QEMU shouldn't be running with FSETID because QEMU is untrusted. FSETGID would allow QEMU to create setgid files, thereby potentially allowing an attacker to gain any GID. I think it's better not to implement QEMU FSETID functionality at all and to handle it another way. In the worst case I/O requests should just fail, it seems like a rare case anyway: I/O to a setuid/setgid file with a memory buffer that is not mapped in virtiofsd. Stefan