Message ID | 20190724094556.GA19383@deco.navytux.spb.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RESEND3] fuse: require /dev/fuse reads to have enough buffer capacity (take 2) | expand |
On Wed, Jul 24, 2019 at 11:46 AM Kirill Smelkov <kirr@nexedi.com> wrote: > > Miklos, > > I was sending this patch for ~1.5 month without any feedback from you[1,2,3]. > The patch was tested by Sander Eikelenboom (original GlusterFS problem > reporter)[4], and you said that it will be ok to retry for next > cycle[5]. I was hoping for this patch to be picked up for 5.3 and queued > to Linus's tree, but in despite several resends from me (the same patch; > just reminders) nothing is happening. v5.3-rc1 came out on last Sunday, > which, in my understanding, denotes the close of 5.3 merge window. What > is going on? Could you please pick up the patch and handle it? Applied. Thanks, Miklos
On Thu, Aug 01, 2019 at 12:35:03PM +0200, Miklos Szeredi wrote: > On Wed, Jul 24, 2019 at 11:46 AM Kirill Smelkov <kirr@nexedi.com> wrote: > > > > Miklos, > > > > I was sending this patch for ~1.5 month without any feedback from you[1,2,3]. > > The patch was tested by Sander Eikelenboom (original GlusterFS problem > > reporter)[4], and you said that it will be ok to retry for next > > cycle[5]. I was hoping for this patch to be picked up for 5.3 and queued > > to Linus's tree, but in despite several resends from me (the same patch; > > just reminders) nothing is happening. v5.3-rc1 came out on last Sunday, > > which, in my understanding, denotes the close of 5.3 merge window. What > > is going on? Could you please pick up the patch and handle it? > > Applied. Thanks...
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index ea8237513dfa..b2b2344eadcf 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1317,6 +1317,26 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, unsigned reqsize; unsigned int hash; + /* + * Require sane minimum read buffer - that has capacity for fixed part + * of any request header + negotiated max_write room for data. If the + * requirement is not satisfied return EINVAL to the filesystem server + * to indicate that it is not following FUSE server/client contract. + * Don't dequeue / abort any request. + * + * Historically libfuse reserves 4K for fixed header room, but e.g. + * GlusterFS reserves only 80 bytes + * + * = `sizeof(fuse_in_header) + sizeof(fuse_write_in)` + * + * which is the absolute minimum any sane filesystem should be using + * for header room. + */ + if (nbytes < max_t(size_t, FUSE_MIN_READ_BUFFER, + sizeof(struct fuse_in_header) + sizeof(struct fuse_write_in) + + fc->max_write)) + return -EINVAL; + restart: spin_lock(&fiq->waitq.lock); err = -EAGAIN;