From 2e84d7f8744ecb0a946088c1a3167e26cbda69a6 Mon Sep 17 00:00:00 2001 From: Konstantin Komarov Date: Tue, 25 Feb 2025 22:59:22 +0900 Subject: [PATCH] fs/ntfs3: Add rough attr alloc_size check BugLink: https://bugs.launchpad.net/bugs/2099996 [ Upstream commit c4a8ba334262e9a5c158d618a4820e1b9c12495c ] Reported-by: syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin CVE-2024-50246 Signed-off-by: Koichiro Den Signed-off-by: Stefan Bader --- fs/ntfs3/record.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index bc888a10f410..f810f0419d25 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -330,6 +330,9 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr) } else { if (attr->nres.c_unit) return NULL; + + if (alloc_size > mi->sbi->volume.size) + return NULL; } return attr;