mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ovl: port ovl_maybe_validate_verity() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-22-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -979,15 +979,10 @@ static int ovl_maybe_validate_verity(struct dentry *dentry)
|
||||
return err;
|
||||
|
||||
if (!ovl_test_flag(OVL_VERIFIED_DIGEST, inode)) {
|
||||
const struct cred *old_cred;
|
||||
|
||||
old_cred = ovl_override_creds(dentry->d_sb);
|
||||
|
||||
err = ovl_validate_verity(ofs, &metapath, &datapath);
|
||||
with_ovl_creds(dentry->d_sb)
|
||||
err = ovl_validate_verity(ofs, &metapath, &datapath);
|
||||
if (err == 0)
|
||||
ovl_set_flag(OVL_VERIFIED_DIGEST, inode);
|
||||
|
||||
ovl_revert_creds(old_cred);
|
||||
}
|
||||
|
||||
ovl_inode_unlock(inode);
|
||||
|
||||
Reference in New Issue
Block a user