fs/ntfs3: Add rough attr alloc_size check

commit c4a8ba334262e9a5c158d618a4820e1b9c12495c upstream.

Reported-by: syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Konstantin Komarov 2024-08-19 16:26:59 +03:00 committed by Greg Kroah-Hartman
parent dbd3e4adb9
commit effac69091

View File

@ -325,6 +325,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;