[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: fix length overflow in FALLOC_FL_KEEP_SIZE

Pavel Butsykin pbutsykin at virtuozzo.com
Fri Jun 7 11:01:35 MSK 2019



On 06.06.2019 15:14, Konstantin Khorenko wrote:
> 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()")

This applies only to the first patch, but not to the second. This bug was always
and has nothing to do with: 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