sysfs: Do not return POSIX ACL xattrs via listxattr
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / fs / xattr.c
index be2ce57cd6ad0c73d8d6bd4ee796981fe302aaad..50029811fbe38377539e10ce9e106ef1617ce5d3 100644 (file)
@@ -951,17 +951,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