Skip to contentSkip to conversation

udf: VAT inode size checks

6.1.y Aymen T 2 participants 2 messages Nov 21 – Nov 22 Stable branch

lore
Share & tools
lore

Aymen T

author
#0 lore raw

Hi,

Please consider these two for 6.1.y:

5163e6ee1ea7 ("udf: validate VAT inode size for old VAT format") 49f771d14578 ("udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()")

6.1.192 still computes the old-format VAT entry count without checking the inode size:

        map->s_type_specific.s_virtual.s_num_entries =
                (sbi->s_vat_inode->i_size - 36) >> 2;

so a VAT inode smaller than 36 bytes gives a huge s_num_entries, and udf_get_pblock_virt15() then reads a VAT entry far past the VAT data. On 6.1.180 in QEMU, with a crafted image on a USB stick, that value became the LBA of the next read.

5163e6ee1ea7 applies cleanly to 6.1.192. 49f771d14578 needs fuzz on its first hunk, because 6.1.y doesn't have the udf_block_map() error handling that surrounds it in mainline; the resulting change is the same two checks. I can send it as a backport if that's easier.

Thanks,
Aymen

maintainer
#1 lore raw
Quoted 4 lines

Please consider these two for 6.1.y:

5163e6ee1ea7 ("udf: validate VAT inode size for old VAT format") 49f771d14578 ("udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()")

Queued for 7.3 (which already had the first one), 6.18, 6.12, 6.6, 6.1, 5.15 and 5.10, thanks.

Signature · 2 lines
Thanks,
Sasha