udf: Check LVID earlier
authorJan Kara <jack@suse.cz>
Mon, 3 May 2021 09:39:03 +0000 (11:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:42:58 +0000 (11:42 +0200)
commit403c6c43907775dd3a76c4d6306e55b92002cdd5
tree7af2dffa10cb0c5284ba2654f218148ffa4759b7
parent624664d15678f387c6e5c09b8148e5f29e76f80b
udf: Check LVID earlier

[ Upstream commit 781d2a9a2fc7d0be53a072794dc03ef6de770f3d ]

We were checking validity of LVID entries only when getting
implementation use information from LVID in udf_sb_lvidiu(). However if
the LVID is suitably corrupted, it can cause problems also to code such
as udf_count_free() which doesn't use udf_sb_lvidiu(). So check validity
of LVID already when loading it from the disk and just disable LVID
altogether when it is not valid.

Reported-by: syzbot+7fbfe5fed73ebb675748@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/udf/super.c