iomap: adjust read range correctly for non-block-aligned positions
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9dc55f1389f9569acf9659e58dd836a9c70df217 · < 142194fb21afe964d2d194cab1fc357cbf87e899| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iomap: adjust read range correctly for non-block-aligned positions
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.
From the CVE record · Linux
The Linux kernel's iomap read-range calculation mishandles non-block-aligned positions, as shown in an erofs case. It can return an incorrect position and length; when all blocks are up to date, the length underflows and the position extends beyond the folio. The input does not establish an attacker path, authentication requirements, or user interaction.
Engineers running the Linux kernel should check whether their version contains the iomap fix; affected versions were not specified.