lkml.org 
[lkml]   [2011]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -V7 21/26] richacl: xattr mapping functions
From
Date
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



\
 
 \ /
  Last update: 2011-10-22 02:01    [from the cache]
©2003-2011 Jasper Spaans