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:45:17 +0000 (11:45 +0200)
commit36dba4791436da05009d1dc54c1708a42462b227
treeedf4816f32a3df61d029859baf887250eb12ab23
parent4c1ad1674231cf2e394ca3697c7d2a534170b5cc
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