Skip to content

Commit c361016

Browse files
Andreas GruenbacherAl Viro
Andreas Gruenbacher
authored and
Al Viro
committed
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>
1 parent 7c7afc4 commit c361016

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/posix_acl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ posix_acl_xattr_get(struct dentry *dentry, const char *name,
768768
struct posix_acl *acl;
769769
int error;
770770

771+
if (strcmp(name, "") != 0)
772+
return -EINVAL;
771773
if (!IS_POSIXACL(d_backing_inode(dentry)))
772774
return -EOPNOTSUPP;
773775
if (d_is_symlink(dentry))
@@ -793,6 +795,8 @@ posix_acl_xattr_set(struct dentry *dentry, const char *name,
793795
struct posix_acl *acl = NULL;
794796
int ret;
795797

798+
if (strcmp(name, "") != 0)
799+
return -EINVAL;
796800
if (!IS_POSIXACL(inode))
797801
return -EOPNOTSUPP;
798802
if (!inode->i_op->set_acl)

0 commit comments

Comments
 (0)