]> www.infradead.org Git - users/dwmw2/linux.git/commit
sysfs: Do not return POSIX ACL xattrs via listxattr
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 18 Sep 2018 04:36:36 +0000 (00:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:56:05 +0000 (08:56 +0200)
commit23917913b67105e34a9c07ca66f1bf4d0a50451e
treefcbd2a4a394f783ecd8e078a323ef3c8ae301270
parent51da3fc5cbceab59a4b78f21f8ee799b30739b80
sysfs: Do not return POSIX ACL xattrs via listxattr

commit ffc4c92227db5699493e43eb140b4cb5904c30ff upstream.

Commit 786534b92f3c introduced a regression that caused listxattr to
return the POSIX ACL attribute names even though sysfs doesn't support
POSIX ACLs.  This happens because simple_xattr_list checks for NULL
i_acl / i_default_acl, but inode_init_always initializes those fields
to ACL_NOT_CACHED ((void *)-1).  For example:
    $ getfattr -m- -d /sys
    /sys: system.posix_acl_access: Operation not supported
    /sys: system.posix_acl_default: Operation not supported
Fix this in simple_xattr_list by checking if the filesystem supports POSIX ACLs.

Fixes: 786534b92f3c ("tmpfs: listxattr should include POSIX ACL xattrs")
Reported-by: Marc Aurèle La France <tsi@tuyoix.net>
Tested-by: Marc Aurèle La France <tsi@tuyoix.net>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xattr.c