f2fs-tools: sanity check segment count
PATCH 1/1 f2fs-tools: sanity check segment count
make sure segment count in super block doesn't exceed F2FS_MAX_SEGMENT.
Signed-off-by Jin Qian <[email protected]>
--- fsck/mount.c | 3 +++ 1 file changed, 3 insertions(+)
fsck/mount.c +3 -0
@@ -406,6 +406,9 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, u64 offset)return -1 ; } +if (get_sb (segment_count) >F2FS_MAX_SEGMENT ) +return -1 ; +if (sanity_check_area_boundary (sb, offset))return -1 ;return 0 ;
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