From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Subject: [PATCH 1/2] vfs: Check attribute names in posix acl xattr handers Date: Tue, 3 Nov 2015 15:25:07 +0100 Message-ID: <1446560708-10897-2-git-send-email-agruenba@redhat.com> References: <1446560708-10897-1-git-send-email-agruenba@redhat.com> Cc: Andreas Gruenbacher To: Alexander Viro , linux-fsdevel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49426 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754095AbbKCOZP (ORCPT ); Tue, 3 Nov 2015 09:25:15 -0500 In-Reply-To: <1446560708-10897-1-git-send-email-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- fs/posix_acl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 4fb17de..b1a66e8 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) -- 2.5.0