aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/security.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-12-02 08:44:36 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-06 21:33:52 -0500
commit98e9cb5711c68223f0e4d5201b9a6add255ec550 (patch)
tree12fee55d296fc85a6e8188368ca4944fc4d913a8 /fs/jffs2/security.c
parent97d79299223baab330b194437e676d301f12d5f6 (diff)
vfs: Distinguish between full xattr names and proper prefixes
Add an additional "name" field to struct xattr_handler. When the name is set, the handler matches attributes with exactly that name. When the prefix is set instead, the handler matches attributes with the given prefix and with a non-empty suffix. This patch should avoid bugs like the one fixed in commit c361016a in the future. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/security.c')
-rw-r--r--fs/jffs2/security.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c
index bf12fe5f83d7..ea79932cd665 100644
--- a/fs/jffs2/security.c
+++ b/fs/jffs2/security.c
@@ -52,9 +52,6 @@ static int jffs2_security_getxattr(const struct xattr_handler *handler,
52 struct dentry *dentry, const char *name, 52 struct dentry *dentry, const char *name,
53 void *buffer, size_t size) 53 void *buffer, size_t size)
54{ 54{
55 if (!strcmp(name, ""))
56 return -EINVAL;
57
58 return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY, 55 return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY,
59 name, buffer, size); 56 name, buffer, size);
60} 57}
@@ -63,9 +60,6 @@ static int jffs2_security_setxattr(const struct xattr_handler *handler,
63 struct dentry *dentry, const char *name, 60 struct dentry *dentry, const char *name,
64 const void *buffer, size_t size, int flags) 61 const void *buffer, size_t size, int flags)
65{ 62{
66 if (!strcmp(name, ""))
67 return -EINVAL;
68
69 return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY, 63 return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY,
70 name, buffer, size, flags); 64 name, buffer, size, flags);
71} 65}