From: Christian Brauner Date: Mon, 17 Nov 2025 09:33:48 +0000 (+0100) Subject: ovl: port do_ovl_get_acl() to cred guard X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71ac28fbcd3309cf6e08b69f611767560f366c0c;p=thirdparty%2Flinux.git ovl: port do_ovl_get_acl() to cred guard Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-17-b31603935724@kernel.org Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner --- diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 31e4fb14ac13f..27c9c3bc77c68 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -459,11 +459,8 @@ struct posix_acl *do_ovl_get_acl(struct mnt_idmap *idmap, acl = get_cached_acl_rcu(realinode, type); } else { - const struct cred *old_cred; - - old_cred = ovl_override_creds(inode->i_sb); - acl = ovl_get_acl_path(&realpath, posix_acl_xattr_name(type), noperm); - ovl_revert_creds(old_cred); + with_ovl_creds(inode->i_sb) + acl = ovl_get_acl_path(&realpath, posix_acl_xattr_name(type), noperm); } return acl;