Files
i2som-imx-linux/fs
Amir Goldstein 45f86fe44e ovl: skip getxattr of security labels
[ Upstream commit 03fedf9359 ]

When inode has no listxattr op of its own (e.g. squashfs) vfs_listxattr
calls the LSM inode_listsecurity hooks to list the xattrs that LSMs will
intercept in inode_getxattr hooks.

When selinux LSM is installed but not initialized, it will list the
security.selinux xattr in inode_listsecurity, but will not intercept it
in inode_getxattr.  This results in -ENODATA for a getxattr call for an
xattr returned by listxattr.

This situation was manifested as overlayfs failure to copy up lower
files from squashfs when selinux is built-in but not initialized,
because ovl_copy_xattr() iterates the lower inode xattrs by
vfs_listxattr() and vfs_getxattr().

ovl_copy_xattr() skips copy up of security labels that are indentified by
inode_copy_up_xattr LSM hooks, but it does that after vfs_getxattr().
Since we are not going to copy them, skip vfs_getxattr() of the security
labels.

Reported-by: Michael Labriola <michael.d.labriola@gmail.com>
Tested-by: Michael Labriola <michael.d.labriola@gmail.com>
Link: https://lore.kernel.org/linux-unionfs/2nv9d47zt7.fsf@aldarion.sourceruckus.org/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-23 15:00:56 +01:00
..
2020-11-05 11:08:53 +01:00
2020-10-30 10:38:28 +01:00
2021-01-30 13:32:13 +01:00
2020-12-30 11:26:13 +01:00
2020-11-18 19:18:49 +01:00
2020-11-05 11:08:50 +01:00
2021-01-30 13:32:13 +01:00
2020-06-22 09:05:01 +02:00
2020-03-05 16:42:12 +01:00
2021-01-30 13:32:11 +01:00
2020-03-25 08:06:14 +01:00