lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5.4 24/92] fuse: verify write return
Date
From: Miklos Szeredi <mszeredi@redhat.com>

commit 8aab336b14c115c6bf1d4baeb9247e41ed9ce6de upstream.

Make sure filesystem is not returning a bogus number of bytes written.

Fixes: ea9b9907b82a ("fuse: implement perform_write")
Cc: <stable@vger.kernel.org> # v2.6.26
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
fs/fuse/file.c | 2 ++
1 file changed, 2 insertions(+)

--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1098,6 +1098,8 @@ static ssize_t fuse_send_write_pages(str
ia->write.in.flags = fuse_write_flags(iocb);

err = fuse_simple_request(fc, &ap->args);
+ if (!err && ia->write.out.size > count)
+ err = -EIO;

offset = ap->descs[0].offset;
count = ia->write.out.size;

\
 
 \ /
  Last update: 2019-12-11 16:08    [W:0.211 / U:13.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site