Commit 4a2d046
committed
erofs: fix interlaced plain identification for encoded extents
Only plain data whose start position and on-disk physical length are
both aligned to the block size should be classified as interlaced
plain extents. Otherwise, it must be treated as shifted plain extents.
This issue was found by syzbot using a crafted compressed image
containing plain extents with unaligned physical lengths, which can
cause OOB read in z_erofs_transform_plain().
Reported-and-tested-by: [email protected]
Closes: https://lore.kernel.org/r/[email protected]
Fixes: 1d191b4 ("erofs: implement encoded extent metadata")
Signed-off-by: Gao Xiang <[email protected]>1 parent bf4fde7 commit 4a2d046
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
| |||
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
599 | 603 | | |
600 | 604 | | |
601 | | - | |
| 605 | + | |
602 | 606 | | |
603 | 607 | | |
604 | 608 | | |
605 | 609 | | |
606 | 610 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| |||
0 commit comments