fs/ntfs3: Fixed overflow check in mi_enum_attr()

commit 652cfeb43d upstream.

Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Konstantin Komarov 2024-01-26 11:14:31 +03:00 committed by Greg Kroah-Hartman
parent 1403991a40
commit e99faa9735

View File

@ -273,7 +273,7 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
if (t16 > asize)
return NULL;
if (t16 + le32_to_cpu(attr->res.data_size) > asize)
if (le32_to_cpu(attr->res.data_size) > asize - t16)
return NULL;
if (attr->name_len &&