f2fs-tools: sanity check blk_off for summary block entries
PATCH 1/1 f2fs-tools: sanity check blk_off for summary block entries
crafted malicious f2fs partition can fill an out of bound blk_off, which cause overflow when accessing summary block entries.
Signed-off-by Jin Qian <[email protected]>
--- fsck/mount.c | 2 ++ 1 file changed, 2 insertions(+)
fsck/mount.c +2 -0
@@ -889,6 +889,8 @@ static void read_compacted_summaries(struct f2fs_sb_info *sbi)else blk_off = curseg->next_blkoff; +ASSERT (blk_off <=ENTRIES_IN_SUM ); +for (j =0 ; j < blk_off; j++) {struct f2fs_summary *s; s = (struct f2fs_summary *)(kaddr + offset);
Signature · 6 lines
2.13.0.rc0.306.g87b477812d-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot