Skip to content

Commit 5163e6e

Browse files
committed
udf: validate VAT inode size for old VAT format
Validate VAT inode is large enough to contain at least the header for pre-2.00 UDF media format. Signed-off-by: Jan Kara <jack@suse.cz>
1 parent d820278 commit 5163e6e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/udf/super.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,11 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
12421242

12431243
if (map->s_partition_type == UDF_VIRTUAL_MAP15) {
12441244
map->s_type_specific.s_virtual.s_start_offset = 0;
1245+
if (sbi->s_vat_inode->i_size < 36) {
1246+
udf_err(sb, "Too short VAT inode size %lld\n",
1247+
sbi->s_vat_inode->i_size);
1248+
return -EFSCORRUPTED;
1249+
}
12451250
map->s_type_specific.s_virtual.s_num_entries =
12461251
(sbi->s_vat_inode->i_size - 36) >> 2;
12471252
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {

0 commit comments

Comments
 (0)