diff options
author | Jan Kara <jack@suse.cz> | 2019-11-22 03:14:38 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-22 19:36:02 +0300 |
commit | 419e9c38aa075ed0cd3c13d47e15954b686bcdb6 (patch) | |
tree | 2856c172882cafbb709ed9c358dc621a55b8a767 /fs/dax.c | |
parent | 6334b91e502ca1ec10157f2a3a2c74eea6b5e279 (diff) | |
download | linux-419e9c38aa075ed0cd3c13d47e15954b686bcdb6.tar.xz |
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: ff6a9292e6f6 ("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>
Diffstat (limited to 'fs/dax.c')
0 files changed, 0 insertions, 0 deletions