diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-18 12:07:11 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-19 00:37:04 +0300 |
commit | 3644e2d2dda78e21edd8f5415b6d7ab03f5f54f3 (patch) | |
tree | e9474ee78d90927d36cd1b730d0df405953afde9 /tools/testing | |
parent | a0b96314870f7eff6d15a242cb162dfc46b3c284 (diff) | |
download | linux-3644e2d2dda78e21edd8f5415b6d7ab03f5f54f3.tar.xz |
mm/filemap: fix infinite loop in generic_file_buffered_read()
If iter->count is 0 and iocb->ki_pos is page aligned, this causes
nr_pages to be 0.
Then in generic_file_buffered_read_get_pages() find_get_pages_contig()
returns 0 - because we asked for 0 pages, so we call
generic_file_buffered_read_no_cached_page() which attempts to add a page
to the page cache, which fails with -EEXIST, and then we loop. Oops...
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Reported-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions