[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: fix length overflow in FALLOC_FL_KEEP_SIZE
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jun 6 15:14:13 MSK 2019
The commit is pushed to "branch-rh7-3.10.0-957.12.2.vz7.96.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.2.vz7.96.12
------>
commit f6741b4f66dfcad52654a8d52a13e0045760e9fc
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date: Thu Jun 6 15:14:12 2019 +0300
fs/fuse kio: fix length overflow in FALLOC_FL_KEEP_SIZE
Fixes: a4c0a32b5b78 ("fs/fuse kio: cosmetic changes in pcs_fuse_prep_rw()")
https://pmc.acronis.com/browse/VSTOR-23781
Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
Acked-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
More information about the Devel
mailing list