Re: [PATCH 5.10.y] iomap: adjust read range correctly for non-block-aligned positions
From: Greg KH
Date: Mon Aug 24 2026 - 09:57:38 EST
On Thu, Aug 20, 2026 at 07:03:07PM +0200, Miguel Gazquez (Schneider Electric) wrote:
> From: Joanne Koong <joannelkoong@xxxxxxxxx>
>
> [ Upstream commit 7aa6bc3e8766990824f66ca76c19596ce10daf3e ]
>
> iomap_adjust_read_range() assumes that the position and length passed in
> are block-aligned. This is not always the case however, as shown in the
> syzbot generated case for erofs. This causes too many bytes to be
> skipped for uptodate blocks, which results in returning the incorrect
> position and length to read in. If all the blocks are uptodate, this
> underflows length and returns a position beyond the folio.
>
> Fix the calculation to also take into account the block offset when
> calculating how many bytes can be skipped for uptodate blocks.
>
> Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx>
> Tested-by: syzbot@xxxxxxxxxxxxxxxxxxxxxxxxx
> Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> Signed-off-by: Miguel Gazquez (Schneider Electric) <miguel.gazquez@xxxxxxxxxxx>
> ---
> fs/iomap/buffered-io.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
Don't we also need this for 5.15.y first?
thanks,
greg k-h