Skip to content
Snippets Groups Projects
Commit ace149e0 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds
Browse files

filemap: Fix bounds checking in filemap_read()


If the caller supplies an iocb->ki_pos value that is close to the
filesystem upper limit, and an iterator with a count that causes us to
overflow that limit, then filemap_read() enters an infinite loop.

This behaviour was discovered when testing xfstests generic/525 with the
"localio" optimisation for loopback NFS mounts.

Reported-by: default avatarMike Snitzer <snitzer@kernel.org>
Fixes: c2a9737f ("vfs,mm: fix a dead loop in truncate_inode_pages_range()")
Tested-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a9cda7c0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment