Commit 55c1c7b2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

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
parents e92677df 0040773b
...@@ -655,6 +655,7 @@ strcmp_prefix(const char *a, const char *a_prefix) ...@@ -655,6 +655,7 @@ strcmp_prefix(const char *a, const char *a_prefix)
* operations to the correct xattr_handler. * operations to the correct xattr_handler.
*/ */
#define for_each_xattr_handler(handlers, handler) \ #define for_each_xattr_handler(handlers, handler) \
if (handlers) \
for ((handler) = *(handlers)++; \ for ((handler) = *(handlers)++; \
(handler) != NULL; \ (handler) != NULL; \
(handler) = *(handlers)++) (handler) = *(handlers)++)
...@@ -668,7 +669,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name) ...@@ -668,7 +669,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
const struct xattr_handler *handler; const struct xattr_handler *handler;
if (!*name) if (!*name)
return NULL; return ERR_PTR(-EINVAL);
for_each_xattr_handler(handlers, handler) { for_each_xattr_handler(handlers, handler) {
const char *n; const char *n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment