mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02: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:
parent
b1c47b3abc
commit
cb3c8cbaed
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user