udf: Avoid invalid LVID used on mount
authorJan Kara <jack@suse.cz>
Mon, 5 Feb 2024 15:24:22 +0000 (16:24 +0100)
committerJan Kara <jack@suse.cz>
Mon, 5 Feb 2024 15:51:59 +0000 (16:51 +0100)
commitc8f1140cb82dc843e72697dc6f8c7ee1acce5d28
tree6ceeda81d254112bf45d048c534474455921c25f
parentd0aa72604fbd80c8aabb46eda00535ed35570f1f
udf: Avoid invalid LVID used on mount

udf_load_logicalvolint() loads logical volume integrity descriptors.
Since there can be multiple blocks with LVIDs, we verify the contents of
only the last (prevailing) LVID found. However if we fail to load the
last LVID (either due to IO error or because it's checksum fails to
match), we never perform the verification of validity of the LVID we are
going to use. If such LVID contains invalid data, we can hit
out-of-bounds access or similar issues. Fix the problem by verifying
each LVID we are potentially going to accept.

Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/super.c