]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 25 May 2016 22:54:35 +0000 (15:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 25 May 2016 22:54:35 +0000 (15:54 -0700)
Pull vfs xattr regression fixes from Al Viro.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  make xattr_resolve_handlers() safe to use with NULL ->s_xattr
  xattr: Fail with -EINVAL for NULL attribute names

fs/xattr.c

index b11945e15fde2b62d59c5c81c5aead48fb0e5d83..fc81e771488a670ebeac9606cc815dab1ded6446 100644 (file)
@@ -655,6 +655,7 @@ strcmp_prefix(const char *a, const char *a_prefix)
  * operations to the correct xattr_handler.
  */
 #define for_each_xattr_handler(handlers, handler)              \
+       if (handlers)                                           \
                for ((handler) = *(handlers)++;                 \
                        (handler) != NULL;                      \
                        (handler) = *(handlers)++)
@@ -668,7 +669,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
        const struct xattr_handler *handler;
 
        if (!*name)
-               return NULL;
+               return ERR_PTR(-EINVAL);
 
        for_each_xattr_handler(handlers, handler) {
                const char *n;