5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jan Kara [ Upstream commit 5163e6ee1ea744d412fe516235bfd9cab15141dc ] Validate VAT inode is large enough to contain at least the header for pre-2.00 UDF media format. Signed-off-by: Jan Kara Signed-off-by: Sasha Levin --- fs/udf/super.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/udf/super.c b/fs/udf/super.c index 6857c15f5a0f4..98f95f0b6f8a7 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1217,6 +1217,11 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) if (map->s_partition_type == UDF_VIRTUAL_MAP15) { map->s_type_specific.s_virtual.s_start_offset = 0; + if (sbi->s_vat_inode->i_size < 36) { + udf_err(sb, "Too short VAT inode size %lld\n", + sbi->s_vat_inode->i_size); + return -EFSCORRUPTED; + } map->s_type_specific.s_virtual.s_num_entries = (sbi->s_vat_inode->i_size - 36) >> 2; } else if (map->s_partition_type == UDF_VIRTUAL_MAP20) { -- 2.53.0