Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2018-10-15 10:56:30 -0500
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2018-10-15 10:56:49 -0500
commit0bb629027bbcef55d1f6529a0d538ec238426fcf (patch)
treee709c966aef272139b130e766993f5f3b577efac
parent724e8629ea52184531059afb2a888406f930f8e2 (diff)
sysfs: Do not return POSIX ACL xattrs via listxattr (git-fixes).
-rw-r--r--patches.fixes/sysfs-Do-not-return-POSIX-ACL-xattrs-via-listxattr.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.fixes/sysfs-Do-not-return-POSIX-ACL-xattrs-via-listxattr.patch b/patches.fixes/sysfs-Do-not-return-POSIX-ACL-xattrs-via-listxattr.patch
new file mode 100644
index 0000000000..f287440baf
--- /dev/null
+++ b/patches.fixes/sysfs-Do-not-return-POSIX-ACL-xattrs-via-listxattr.patch
@@ -0,0 +1,62 @@
+From ffc4c92227db5699493e43eb140b4cb5904c30ff Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruenba@redhat.com>
+Date: Tue Sep 18 00:36:36 2018 -0400
+Subject: [PATCH] sysfs: Do not return POSIX ACL xattrs via listxattr
+Git-commit: ffc4c92227db5699493e43eb140b4cb5904c30ff
+References: git-fixes
+Patch-mainline: v4.19-rc7
+
+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>
+Acked-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
+
+diff --git a/fs/xattr.c b/fs/xattr.c
+index daa7325..0d6a6a4 100644
+
+--- a/fs/xattr.c
++++ b/fs/xattr.c
+@@ -948,17 +948,19 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
+ int err = 0;
+
+ #ifdef CONFIG_FS_POSIX_ACL
+- if (inode->i_acl) {
+- err = xattr_list_one(&buffer, &remaining_size,
+- XATTR_NAME_POSIX_ACL_ACCESS);
+- if (err)
+- return err;
+- }
+- if (inode->i_default_acl) {
+- err = xattr_list_one(&buffer, &remaining_size,
+- XATTR_NAME_POSIX_ACL_DEFAULT);
+- if (err)
+- return err;
++ if (IS_POSIXACL(inode)) {
++ if (inode->i_acl) {
++ err = xattr_list_one(&buffer, &remaining_size,
++ XATTR_NAME_POSIX_ACL_ACCESS);
++ if (err)
++ return err;
++ }
++ if (inode->i_default_acl) {
++ err = xattr_list_one(&buffer, &remaining_size,
++ XATTR_NAME_POSIX_ACL_DEFAULT);
++ if (err)
++ return err;
++ }
+ }
+ #endif
+
diff --git a/series.conf b/series.conf
index b0dfdb98d5..df7925a1a4 100644
--- a/series.conf
+++ b/series.conf
@@ -17821,6 +17821,7 @@
patches.drivers/Input-elantech-enable-middle-button-of-touchpad-on-T.patch
patches.arch/x86-boot-fix-kexec-booting-failure-in-the-sev-bit-detection-code.patch
patches.drivers/soc-fsl-qe-Fix-copy-paste-bug-in-ucc_get_tdm_sync_sh.patch
+ patches.fixes/sysfs-Do-not-return-POSIX-ACL-xattrs-via-listxattr.patch
patches.drivers/qed-Fix-shmem-structure-inconsistency-between-driver.patch
patches.drivers/cfg80211-reg-Init-wiphy_idx-in-regulatory_hint_core.patch
patches.drivers/mac80211-fix-pending-queue-hang-due-to-TX_DROP.patch