Commit 4f98fe43 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Greg Kroah-Hartman

ovl: fix lseek overflow on 32bit

[ Upstream commit a4ac9d45 ]

ovl_lseek() is using ssize_t to return the value from vfs_llseek().  On a
32-bit kernel ssize_t is a 32-bit signed int, which overflows above 2 GB.

Assign the return value of vfs_llseek() to loff_t to fix this.
Reported-by: default avatarBoris Gjenero <boris.gjenero@gmail.com>
Fixes: 9e46b840 ("ovl: support stacked SEEK_HOLE/SEEK_DATA")
Cc: <stable@vger.kernel.org> # v4.19
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 41be0c32
...@@ -149,7 +149,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) ...@@ -149,7 +149,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
struct fd real; struct fd real;
const struct cred *old_cred; const struct cred *old_cred;
ssize_t ret; loff_t ret;
/* /*
* The two special cases below do not need to involve real fs, * The two special cases below do not need to involve real fs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment