fsck.f2fs: fix cur_valid_map buffer overflow
PATCH 1/1 fsck.f2fs: fix cur_valid_map buffer overflow
blk_off is read from image. Attacker can construct an image with big blk_off that trigger overflow on se->cur_valid_map.
Signed-off-by Jin Qian <[email protected]>
--- fsck/fsck.c | 2 ++ 1 file changed, 2 insertions(+)
fsck/fsck.c +2 -0
@@ -1825,6 +1825,8 @@ int check_curseg_offset(struct f2fs_sb_info *sbi)struct seg_entry *se;int j, nblocks; +if ((curseg->next_blkoff >>3 ) >=SIT_VBLOCK_MAP_SIZE ) +return -EINVAL ; se =get_seg_entry (sbi, curseg->segno);if (f2fs_test_bit (curseg->next_blkoff, (const char *)se->cur_valid_map)) {
Signature · 6 lines
2.12.2.762.g0e3151a226-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot