From: Christian Brauner Date: Mon, 17 Nov 2025 09:33:39 +0000 (+0100) Subject: ovl: port ovl_llseek() to cred guard X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fc4bc77c7865732694c6d32c98d990b2b1cddc8;p=thirdparty%2Fkernel%2Flinux.git ovl: port ovl_llseek() to cred guard Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-8-b31603935724@kernel.org Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner --- diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index ebcd737e87ef1..70ddb51297ce8 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -243,7 +243,6 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) { struct inode *inode = file_inode(file); struct file *realfile; - const struct cred *old_cred; loff_t ret; /* @@ -272,9 +271,8 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) ovl_inode_lock(inode); realfile->f_pos = file->f_pos; - old_cred = ovl_override_creds(inode->i_sb); - ret = vfs_llseek(realfile, offset, whence); - ovl_revert_creds(old_cred); + with_ovl_creds(inode->i_sb) + ret = vfs_llseek(realfile, offset, whence); file->f_pos = realfile->f_pos; ovl_inode_unlock(inode);