From: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx> [ Upstream commit c4a8ba334262e9a5c158d618a4820e1b9c12495c ] Reported-by: syzbot+c6d94bedd910a8216d25@xxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Bin Lan <bin.lan.cn@xxxxxxxxxxxxx> --- fs/ntfs3/record.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index 7ab452710572..0cdff04d084b 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -329,6 +329,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; -- 2.43.0