Re: [PATCH 3/6] Check that the new path while moving a file is not too long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 09, 2019 at 03:31:54PM +0200, philipp.ammann@xxxxxxxxx wrote:
> From: Andreas Schneider <asn@xxxxxxxxxxxxxx>

[no subject prefix, and maybe use scripts/get_maintainer.pl... ]

> 
> Signed-off-by: Andreas Schneider <asn@xxxxxxxxxxxxxx>
> ---
>  drivers/staging/exfat/exfat_super.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
> index 5f6caee819a6..b63186a67af6 100644
> --- a/drivers/staging/exfat/exfat_super.c
> +++ b/drivers/staging/exfat/exfat_super.c
> @@ -1300,6 +1300,9 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid,
>  	}
>  
>  	/* check the validity of directory name in the given new pathname */
> +	if (strlen(new_path) >= MAX_NAME_LENGTH)
> +		return FFS_NAMETOOLONG;
> +

odd here, AFAIK, namelen should be checked in ->lookup()
for many filesystems (why such dentries exist?) and
the length can be also gotten by dentry->d_name.len
(it's also stable here).

Maybe sort out what original problem here is better and
not blindly get patches from random github repos...

Thanks,
Gao Xiang

>  	ret = resolve_path(new_parent_inode, new_path, &newdir, &uni_name);
>  	if (ret)
>  		goto out2;
> -- 
> 2.21.0
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux