aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-11-03 09:25:07 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-11-13 20:34:28 -0500
commitc361016adeb5acb17a67000689602b7515930f13 (patch)
treec7010c5e0a6a96904d163e7a6549ccf3e6def8ff
parent7c7afc440c8ec311ae135df892cc489436a1ff00 (diff)
vfs: Check attribute names in posix acl xattr handers
The get and set operations of the POSIX ACL xattr handlers failed to check the attribute names, so all names with "system.posix_acl_access" or "system.posix_acl_default" as a prefix were accepted. Reject invalid names from now on. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/posix_acl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 4fb17ded7d47..b1a66e844d35 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -768,6 +768,8 @@ posix_acl_xattr_get(struct dentry *dentry, const char *name,
768 struct posix_acl *acl; 768 struct posix_acl *acl;
769 int error; 769 int error;
770 770
771 if (strcmp(name, "") != 0)
772 return -EINVAL;
771 if (!IS_POSIXACL(d_backing_inode(dentry))) 773 if (!IS_POSIXACL(d_backing_inode(dentry)))
772 return -EOPNOTSUPP; 774 return -EOPNOTSUPP;
773 if (d_is_symlink(dentry)) 775 if (d_is_symlink(dentry))
@@ -793,6 +795,8 @@ posix_acl_xattr_set(struct dentry *dentry, const char *name,
793 struct posix_acl *acl = NULL; 795 struct posix_acl *acl = NULL;
794 int ret; 796 int ret;
795 797
798 if (strcmp(name, "") != 0)
799 return -EINVAL;
796 if (!IS_POSIXACL(inode)) 800 if (!IS_POSIXACL(inode))
797 return -EOPNOTSUPP; 801 return -EOPNOTSUPP;
798 if (!inode->i_op->set_acl) 802 if (!inode->i_op->set_acl)