]> Git Repo - linux.git/commit
filemap: Fix bounds checking in filemap_read()
authorTrond Myklebust <[email protected]>
Fri, 13 Sep 2024 17:57:04 +0000 (13:57 -0400)
committerLinus Torvalds <[email protected]>
Sun, 10 Nov 2024 22:07:08 +0000 (14:07 -0800)
commitace149e0830c380ddfce7e466fe860ca502fe4ee
tree56dcd5d10190831e96e235d13143bc08de5f0941
parenta9cda7c0ffedb47b23002e109bd26ab2a2ab99c9
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: Mike Snitzer <[email protected]>
Fixes: c2a9737f45e2 ("vfs,mm: fix a dead loop in truncate_inode_pages_range()")
Tested-by: Mike Snitzer <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/filemap.c
This page took 0.064771 seconds and 4 git commands to generate.