[SRU Focal 1/1] ovl: adhere to the vfs_ vs. ovl_do_ conventions for xattrs
Thadeu Lima de Souza Cascardo
cascardo at canonical.com
Thu Jul 6 20:41:02 UTC 2023
From: Miklos Szeredi <mszeredi at redhat.com>
Call ovl_do_*xattr() when accessing an overlay private xattr, vfs_*xattr()
otherwise.
This has an effect on debug output, which is made more consistent by this
patch.
Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
(cherry picked from commit 7109704705a4d80516de00779bba38b3844bff13)
CVE-2023-32629
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
---
fs/overlayfs/copy_up.c | 6 +++---
fs/overlayfs/super.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 60bf2066b819..fcb1a623d8f6 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -784,14 +784,14 @@ static int ovl_copy_up_meta_inode_data(struct ovl_copy_up_ctx *c)
* don't want that to happen for normal copy-up operation.
*/
if (capability) {
- err = ovl_do_setxattr(upperpath.dentry, XATTR_NAME_CAPS,
- capability, cap_size, 0);
+ err = vfs_setxattr(upperpath.dentry, XATTR_NAME_CAPS,
+ capability, cap_size, 0);
if (err)
goto out_free;
}
- err = vfs_removexattr(upperpath.dentry, OVL_XATTR_METACOPY);
+ err = ovl_do_removexattr(upperpath.dentry, OVL_XATTR_METACOPY);
if (err)
goto out_free;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index aed79f56d4b8..ebf5da36eef6 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1137,7 +1137,7 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
pr_warn("overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.\n");
err = 0;
} else {
- vfs_removexattr(ofs->workdir, OVL_XATTR_OPAQUE);
+ ovl_do_removexattr(ofs->workdir, OVL_XATTR_OPAQUE);
}
/* Check if upper/work fs supports file handles */
--
2.34.1
More information about the kernel-team
mailing list