[Devel] fuse: fix junk at in kio name

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Aug 31 16:37:05 MSK 2021


 > @@ -782,7 +782,7 @@ static int fuse_parse_param(struct fs_context 
*fc, struct fs_parameter *param)

 >

 >               if (param->size > FUSE_KIO_NAME)

 >

 >                       return -EINVAL;

 >

 >

 >

 > -             strncpy(ctx->kio_name, param->string, param->size);

 >

 > +             strncpy(ctx->kio_name, param->string, FUSE_KIO_NAME);

 >

 >               ctx->kio_name[FUSE_KIO_NAME] = '\0';

 >

 >               ctx->kdirect_io = 1;

 >



Please take a look on OPT_SUBTYPE and OPT_SOURCE options, do we actually 
need strncpy here? vfs_parse_fs_string with it's kmemdup_nul already 
puts null-terminated string in param.string, similarly null-terminated 
string is provided by sys_fsconfig with strndup_user(_value, 256);


On 31.08.2021 16:08, Alexey Kuznetsov wrote:
> Patch "fuse: Fix fuse_parse_param() kio_name handling #PSBM-131962" has a silly
> mistake
> 
> Affects: #VSTOR-45882
> https://pmc.acronis.com/browse/VSTOR-45882
> 
> 
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel
> 

-- 
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.


More information about the Devel mailing list