From: Miklos Szeredi Date: Mon, 3 Feb 2020 10:41:53 +0000 (+0100) Subject: ovl: fix lseek overflow on 32bit X-Git-Tag: v5.6-rc1~65^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a4ac9d45c0cd14a2adc872186431c79804b77dbf;p=users%2Fjedix%2Flinux-maple.git ovl: fix lseek overflow on 32bit 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 Fixes: 9e46b840c705 ("ovl: support stacked SEEK_HOLE/SEEK_DATA") Cc: # v4.19 Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 67ef4c8cfdc7..a5317216de73 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -157,7 +157,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,