[2/2] fs/fuse kio: fix length overflow in FALLOC_FL_KEEP_SIZE

Submitted by Pavel Butsykin on June 5, 2019, 3:50 p.m.

Details

Message ID 20190605155022.23582-2-pbutsykin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Pavel Butsykin June 5, 2019, 3:50 p.m.
#VSTOR-23781

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 60c47aaf592e..bdaca666f6e9 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1049,6 +1049,8 @@  static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 		}
 
 		if (inarg->mode & FALLOC_FL_KEEP_SIZE) {
+			if (inarg->offset > di->fileinfo.attr.size)
+				break; /* NOPE */
 			if (inarg->offset + inarg->length > di->fileinfo.attr.size)
 				inarg->length = di->fileinfo.attr.size - inarg->offset;
 		}