Commit 618e2574 authored by Konstantin Komarov's avatar Konstantin Komarov Committed by Zizhi Wo
Browse files

fs/ntfs3: Add rough attr alloc_size check

stable inclusion
from stable-v6.6.60
commit e91fbb21f248bdd8140f343dac32b77b9bc10fec
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB37BA
CVE: CVE-2024-50246

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e91fbb21f248bdd8140f343dac32b77b9bc10fec



--------------------------------

[ Upstream commit c4a8ba334262e9a5c158d618a4820e1b9c12495c ]

Reported-by: default avatar <syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
parent 53677a49
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -319,6 +319,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;