summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2020-02-03 11:41:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-11 04:33:50 -0800
commit4f98fe43cdaaeced34c2e6f6d1b76ed0d712bd2a (patch)
tree6e12c0ab2423f0d320854037c75d04de5cb73753
parent41be0c3295e23374882aa53b651a00515c4a032d (diff)
ovl: fix lseek overflow on 32bit
[ Upstream commit a4ac9d45c0cd14a2adc872186431c79804b77dbf ] 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: Boris Gjenero <boris.gjenero@gmail.com> Fixes: 9e46b840c705 ("ovl: support stacked SEEK_HOLE/SEEK_DATA") Cc: <stable@vger.kernel.org> # v4.19 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/overlayfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 0bd276e4ccbe..fa5ac5de807c 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -149,7 +149,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
struct inode *inode = file_inode(file);
struct fd real;
const struct cred *old_cred;
- ssize_t ret;
+ loff_t ret;
/*
* The two special cases below do not need to involve real fs,