From: Andreas Gruenbacher Date: Tue, 3 Nov 2015 14:25:07 +0000 (+0100) Subject: vfs: Check attribute names in posix acl xattr handers X-Git-Tag: v4.4-rc1~14^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c361016adeb5acb17a67000689602b7515930f13;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Al Viro --- 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, struct posix_acl *acl; int error; + if (strcmp(name, "") != 0) + return -EINVAL; if (!IS_POSIXACL(d_backing_inode(dentry))) return -EOPNOTSUPP; if (d_is_symlink(dentry)) @@ -793,6 +795,8 @@ posix_acl_xattr_set(struct dentry *dentry, const char *name, struct posix_acl *acl = NULL; int ret; + if (strcmp(name, "") != 0) + return -EINVAL; if (!IS_POSIXACL(inode)) return -EOPNOTSUPP; if (!inode->i_op->set_acl)