svn commit: r344857 - head/sys/fs/fuse
Conrad Meyer
cem at freebsd.org
Thu Mar 7 18:36:57 UTC 2019
Hi Konstantin,
On Thu, Mar 7, 2019 at 3:00 AM Konstantin Belousov <kostikbel at gmail.com> wrote:
>
> On Wed, Mar 06, 2019 at 10:56:49PM +0000, Conrad Meyer wrote:
> > FUSE: Prevent trivial panic
> >
> > When open(2) was invoked against a FUSE filesystem with an unexpected flags
> > value (no O_RDONLY / O_RDWR / O_WRONLY), an assertion fired, causing panic.
>
> Did you miss O_EXEC ?
Nope.
> O_RDONLY is defined as zero, and we interpret the
> flags as having O_RDONLY if no other flags were passed.
The commit message probably could have been more clear. The check
that we actually perform (and guard against with this change) is
((flags & (FREAD | FWRITE)) == 0). FREAD is non-zero. Alan has
empirically demonstrated that O_EXEC at the open(2) layer does not
translate into a FREAD flag at the VOP_OPEN() layer.
> VFS guarantees that one of the O_EXEC/FREAD/FWRITE flag is always
> there. If it does not, it is bug. See the code at the start of
> kern_openat().
Sure. FUSE is not prepared to handle (flags & (O_EXEC|FREAD|FWRITE))
== O_EXEC at this time. This revision just changes that
(user-inducible) scenario into an error, instead of a panic.
Like the commit message says, it is not intended to be the correct
long-term solution.
Best,
Conrad
More information about the svn-src-all
mailing list