diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-25 18:54:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-25 18:54:35 -0400 |
commit | 55c1c7b2b66e3011f981d81aaf21fa810935908a (patch) | |
tree | aa3ddd06f7b0224236b64661c15d6b304abcc58c | |
parent | e92677dfce88b96ade9100c77eb3f76d98d29d74 (diff) | |
parent | 0040773bff7b585fc948565a0558e5a6a4680e96 (diff) |
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
-rw-r--r-- | fs/xattr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xattr.c b/fs/xattr.c index b11945e15fde..fc81e771488a 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -655,6 +655,7 @@ strcmp_prefix(const char *a, const char *a_prefix) | |||
655 | * operations to the correct xattr_handler. | 655 | * operations to the correct xattr_handler. |
656 | */ | 656 | */ |
657 | #define for_each_xattr_handler(handlers, handler) \ | 657 | #define for_each_xattr_handler(handlers, handler) \ |
658 | if (handlers) \ | ||
658 | for ((handler) = *(handlers)++; \ | 659 | for ((handler) = *(handlers)++; \ |
659 | (handler) != NULL; \ | 660 | (handler) != NULL; \ |
660 | (handler) = *(handlers)++) | 661 | (handler) = *(handlers)++) |
@@ -668,7 +669,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name) | |||
668 | const struct xattr_handler *handler; | 669 | const struct xattr_handler *handler; |
669 | 670 | ||
670 | if (!*name) | 671 | if (!*name) |
671 | return NULL; | 672 | return ERR_PTR(-EINVAL); |
672 | 673 | ||
673 | for_each_xattr_handler(handlers, handler) { | 674 | for_each_xattr_handler(handlers, handler) { |
674 | const char *n; | 675 | const char *n; |