mirror of
https://github.com/torvalds/linux.git
synced 2024-12-24 03:42:52 +00:00
udf: Fix BUG on corrupted inode
When inode is corrupted so that extent type is invalid, some functions (such as udf_truncate_extents()) will just BUG. Check that extent type is valid when loading the inode to memory. Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
3e159b9553
commit
d288d95842
@ -1357,6 +1357,12 @@ reread:
|
||||
|
||||
iinfo->i_alloc_type = le16_to_cpu(fe->icbTag.flags) &
|
||||
ICBTAG_FLAG_AD_MASK;
|
||||
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_SHORT &&
|
||||
iinfo->i_alloc_type != ICBTAG_FLAG_AD_LONG &&
|
||||
iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
iinfo->i_unique = 0;
|
||||
iinfo->i_lenEAttr = 0;
|
||||
iinfo->i_lenExtents = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user