linux/fs/iomap
Jan Kara 419e9c38aa iomap: Fix pipe page leakage during splicing
When splicing using iomap_dio_rw() to a pipe, we may leak pipe pages
because bio_iov_iter_get_pages() records that the pipe will have full
extent worth of data however if file size is not block size aligned
iomap_dio_rw() returns less than what bio_iov_iter_get_pages() set up
and splice code gets confused leaking a pipe page with the file tail.

Handle the situation similarly to the old direct IO implementation and
revert iter to actually returned read amount which makes iter consistent
with value returned from iomap_dio_rw() and thus the splice code is
happy.

Fixes: ff6a9292e6 ("iomap: implement direct I/O")
CC: stable@vger.kernel.org
Reported-by: syzbot+991400e8eba7e00a26e1@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2019-11-22 08:36:02 -08:00
..
apply.c iomap: trace iomap_appply results 2019-11-22 08:36:00 -08:00
buffered-io.c iomap: Fix overflow in iomap_page_mkwrite 2019-11-07 07:28:18 -08:00
direct-io.c iomap: Fix pipe page leakage during splicing 2019-11-22 08:36:02 -08:00
fiemap.c iomap: iomap_bmap should check iomap_apply return value 2019-11-08 07:44:12 -08:00
Makefile iomap: lift common tracing code from xfs to iomap 2019-10-21 08:51:59 -07:00
seek.c iomap: use a srcmap for a read-modify-write I/O 2019-10-21 08:51:59 -07:00
swapfile.c iomap: use a srcmap for a read-modify-write I/O 2019-10-21 08:51:59 -07:00
trace.c iomap: lift common tracing code from xfs to iomap 2019-10-21 08:51:59 -07:00
trace.h iomap: trace iomap_appply results 2019-11-22 08:36:00 -08:00