]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ovl: port do_ovl_get_acl() to cred guard
authorChristian Brauner <brauner@kernel.org>
Mon, 17 Nov 2025 09:33:48 +0000 (10:33 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 19 Nov 2025 20:58:22 +0000 (21:58 +0100)
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 <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/overlayfs/inode.c

index 31e4fb14ac13fee86cc7cd98e7023a46704b5ec7..27c9c3bc77c68de90f1961c35595076fd1af9aef 100644 (file)
@@ -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;