Re: [PATCH -V7 21/26] richacl: xattr mapping functions

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

 



On Fri, 2011-10-21 at 18:42 +0530, Aneesh Kumar K.V wrote:
> diff --git a/fs/richacl_xattr.c b/fs/richacl_xattr.c
> index 02a7986..31e33b5 100644
> --- a/fs/richacl_xattr.c
> +++ b/fs/richacl_xattr.c
> @@ -58,19 +58,14 @@ richacl_from_xattr(const void *value, size_t size)
>  		goto fail_einval;
>  
>  	richacl_for_each_entry(ace, acl) {
> -		const char *who = (void *)(xattr_ace + 1), *end;
> -		ssize_t used = (void *)who - value;
>  
> -		if (used > size)
> -			goto fail_einval;
> -		end = memchr(who, 0, size - used);
> -		if (!end)
> +		if (((void *)xattr_ace + sizeof(*xattr_ace)) > (value + size))
>  			goto fail_einval;

This check can be moved out of the loop now.

Other than that, I'm happy with the patch; acked.

Thanks,
Andreas

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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