mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
ovl: port ovl_maybe_lookup_lowerdata() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-23-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -996,7 +996,6 @@ static int ovl_maybe_lookup_lowerdata(struct dentry *dentry)
|
||||
struct inode *inode = d_inode(dentry);
|
||||
const char *redirect = ovl_lowerdata_redirect(inode);
|
||||
struct ovl_path datapath = {};
|
||||
const struct cred *old_cred;
|
||||
int err;
|
||||
|
||||
if (!redirect || ovl_dentry_lowerdata(dentry))
|
||||
@@ -1014,9 +1013,8 @@ static int ovl_maybe_lookup_lowerdata(struct dentry *dentry)
|
||||
if (ovl_dentry_lowerdata(dentry))
|
||||
goto out;
|
||||
|
||||
old_cred = ovl_override_creds(dentry->d_sb);
|
||||
err = ovl_lookup_data_layers(dentry, redirect, &datapath);
|
||||
ovl_revert_creds(old_cred);
|
||||
with_ovl_creds(dentry->d_sb)
|
||||
err = ovl_lookup_data_layers(dentry, redirect, &datapath);
|
||||
if (err)
|
||||
goto out_err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user