From: Konstantin Komarov Date: Mon, 19 Aug 2024 13:26:59 +0000 (+0300) Subject: fs/ntfs3: Add rough attr alloc_size check X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c4a8ba334262e9a5c158d618a4820e1b9c12495c;p=users%2Fwilly%2Flinux.git fs/ntfs3: Add rough attr alloc_size check Reported-by: syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com Signed-off-by: Konstantin Komarov --- diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index 2a375247b3c0..427c71be0f08 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -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;