Re: [Virtio-fs] [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-02-05 Thread Chirantan Ekbote
On Tue, Feb 2, 2021 at 3:22 AM Stefan Hajnoczi wrote: > Hi Chirantan, > I wanted to bring this CVE to your attention because the discussion has > revealed a number of other issues (not necessarily security issues) in > virtiofsd that may also be present in other virtio-fs daemon > implementations.

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-02-01 Thread Greg Kurz
On Mon, 1 Feb 2021 17:14:40 + Stefan Hajnoczi wrote: > On Thu, Jan 28, 2021 at 06:44:16PM +0100, Greg Kurz wrote: > > On Wed, 27 Jan 2021 11:21:31 + > > Stefan Hajnoczi wrote: > > > > > A well-behaved FUSE client does not attempt to open special files with > > > FUSE_OPEN because they a

Re: [Virtio-fs] [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-02-01 Thread Stefan Hajnoczi
On Mon, Feb 01, 2021 at 05:14:40PM +, Stefan Hajnoczi wrote: > On Thu, Jan 28, 2021 at 06:44:16PM +0100, Greg Kurz wrote: > > On Wed, 27 Jan 2021 11:21:31 + > > Stefan Hajnoczi wrote: > > > > > A well-behaved FUSE client does not attempt to open special files with > > > FUSE_OPEN because

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-02-01 Thread Stefan Hajnoczi
On Thu, Jan 28, 2021 at 06:44:16PM +0100, Greg Kurz wrote: > On Wed, 27 Jan 2021 11:21:31 + > Stefan Hajnoczi 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 cli

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-28 Thread Greg Kurz
On Wed, 27 Jan 2021 11:21:31 + Stefan Hajnoczi 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 open

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-28 Thread Stefan Hajnoczi
On Wed, Jan 27, 2021 at 04:23:32PM +0100, Greg Kurz wrote: > On Wed, 27 Jan 2021 14:14:30 + > Stefan Hajnoczi wrote: > > > On Wed, Jan 27, 2021 at 02:01:54PM +0100, Miklos Szeredi wrote: > > > On Wed, Jan 27, 2021 at 12:21 PM Stefan Hajnoczi > > > wrote: > > > } > > > > @@ -16

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-28 Thread Stefan Hajnoczi
On Wed, Jan 27, 2021 at 03:27:23PM +0100, Miklos Szeredi wrote: > On Wed, Jan 27, 2021 at 3:14 PM Stefan Hajnoczi wrote: > > > > On Wed, Jan 27, 2021 at 02:01:54PM +0100, Miklos Szeredi wrote: > > > > The problem here is there can also be a race between the open and the > > > subsequent lo_do_loo

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-27 Thread Greg Kurz
On Wed, 27 Jan 2021 14:14:30 + Stefan Hajnoczi wrote: > On Wed, Jan 27, 2021 at 02:01:54PM +0100, Miklos Szeredi wrote: > > On Wed, Jan 27, 2021 at 12:21 PM Stefan Hajnoczi > > wrote: > > } > > > @@ -1654,9 +1677,11 @@ static void update_open_flags(int writeback, int > > > al

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-27 Thread Miklos Szeredi
On Wed, Jan 27, 2021 at 3:14 PM Stefan Hajnoczi wrote: > > On Wed, Jan 27, 2021 at 02:01:54PM +0100, Miklos Szeredi wrote: > > The problem here is there can also be a race between the open and the > > subsequent lo_do_lookup(). > > > > At this point it's probably enough to verify that fuse_entry_

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-27 Thread Stefan Hajnoczi
On Wed, Jan 27, 2021 at 02:01:54PM +0100, Miklos Szeredi wrote: > On Wed, Jan 27, 2021 at 12:21 PM Stefan Hajnoczi wrote: > } > > @@ -1654,9 +1677,11 @@ static void update_open_flags(int writeback, int > > allow_direct_io, > > static void lo_create(fuse_req_t req, fuse_ino_t parent

Re: [PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-27 Thread Miklos Szeredi
On Wed, Jan 27, 2021 at 12:21 PM Stefan Hajnoczi wrote: } > @@ -1654,9 +1677,11 @@ static void update_open_flags(int writeback, int > allow_direct_io, > static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name, >mode_t mode, struct fuse_file

[PATCH v3] virtiofsd: prevent opening of special files (CVE-2020-35517)

2021-01-27 Thread Stefan Hajnoczi
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