mirror of https://github.com/torvalds/linux.git
ovl: port ovl_dir_llseek() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-26-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
d25e4b739f
commit
5517646e14
|
|
@ -955,14 +955,8 @@ static loff_t ovl_dir_llseek(struct file *file, loff_t offset, int origin)
|
||||||
static struct file *ovl_dir_open_realfile(const struct file *file,
|
static struct file *ovl_dir_open_realfile(const struct file *file,
|
||||||
const struct path *realpath)
|
const struct path *realpath)
|
||||||
{
|
{
|
||||||
struct file *res;
|
with_ovl_creds(file_inode(file)->i_sb)
|
||||||
const struct cred *old_cred;
|
return ovl_path_open(realpath, O_RDONLY | (file->f_flags & O_LARGEFILE));
|
||||||
|
|
||||||
old_cred = ovl_override_creds(file_inode(file)->i_sb);
|
|
||||||
res = ovl_path_open(realpath, O_RDONLY | (file->f_flags & O_LARGEFILE));
|
|
||||||
ovl_revert_creds(old_cred);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue