fs/ntfs3: Add rough attr alloc_size check

[ Upstream commit c4a8ba334262e9a5c158d618a4820e1b9c12495c ]

Reported-by: syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Konstantin Komarov 2024-08-19 16:26:59 +03:00 committed by Greg Kroah-Hartman
parent 898c8795ec
commit e91fbb21f2

View file

@ -331,6 +331,9 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
if (attr->nres.c_unit)
return NULL;
if (alloc_size > mi->sbi->volume.size)
return NULL;
}
return attr;