fuse: don't overflow LLONG_MAX with end offset
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 6 Feb 2020 15:39:28 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:37:03 +0000 (08:37 +0100)
commit399ca7ee91300129eb0f5d0cba9c0aeba00908c3
tree52a785c3f9864f72cd463b87a78dd5a0448091ec
parent77912b69a989629c72922df67d27bcabdd80832a
fuse: don't overflow LLONG_MAX with end offset

[ Upstream commit 2f1398291bf35fe027914ae7a9610d8e601fbfde ]

Handle the special case of fuse_readpages() wanting to read the last page
of a hugest file possible and overflowing the end offset in the process.

This is basically to unbreak xfstests:generic/525 and prevent filesystems
from doing bad things with an overflowing offset.

Reported-by: Xiao Yang <ice_yangxiao@163.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/file.c