Message ID | 561769bb80c6df3c88d4aa1fdc67bfa2a031f1ab.1632956136.git.luke.nowakowskikrijger@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2019-19449 | expand |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index bda5687ef138..5a8e9ae9fccd 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2610,6 +2610,12 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, return -EFSCORRUPTED; } + if (segment_count_main != total_sections * segs_per_sec) { + f2fs_info(sbi, "Invalid segment/section count (%u != %u * %u)", + segment_count_main, total_sections, segs_per_sec); + return -EFSCORRUPTED; + } + if ((segment_count / segs_per_sec) < total_sections) { f2fs_info(sbi, "Small segment_count (%u < %u * %u)", segment_count, segs_per_sec, total_sections);