On Tue, Jan 26, 2021 at 06:16:04PM +0100, Greg Kurz wrote: > On Tue, 26 Jan 2021 10:35:02 +0000 > Stefan Hajnoczi <stefa...@redhat.com> wrote: > > > A well-behaved FUSE client does not attempt to open special files with > > FUSE_OPEN because they are handled on the client side (e.g. device nodes > > are handled by client-side device drivers). > > > > The check to prevent virtiofsd from opening special files is missing in > > a few cases, most notably FUSE_OPEN. A malicious client can cause > > virtiofsd to open a device node, potentially allowing the guest to > > escape. > > or pretty much anything nasty you can think of, e.g. DoS if the malicious > client repeatedly asks virtiofsd to open FIFOs the other side of which is > never opened. > > > This can be exploited by a modified guest device driver. It is > > not exploitable from guest userspace since the guest kernel will handle > > special files inside the guest instead of sending FUSE requests. > > > > This patch adds the missing checks to virtiofsd. This is a short-term > > solution because it does not prevent a compromised virtiofsd process > > from opening device nodes on the host. > > > > Reported-by: Alex Xu <a...@alxu.ca> > > Fixes: CVE-2020-35517 > > Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > > Reviewed-by: Vivek Goyal <vgo...@redhat.com> > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > > --- > > The patch looks pretty good to me. It just seems to be missing a change in > lo_create(): > > fd = openat(parent_inode->fd, name, (fi->flags | O_CREAT) & ~O_NOFOLLOW, > mode); > > A malicious guest could have created anything called ${name} in this directory > before calling FUSE_CREATE and we'll open it blindly, or I'm missing > something ?
Good point! I will send another revision. Stefan
signature.asc
Description: PGP signature