fs/ntfs3: Fixed overflow check in mi_enum_attr()

Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Konstantin Komarov 2024-01-26 11:14:31 +03:00
parent 1b7dd28e14
commit 652cfeb43d
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -279,7 +279,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;
t32 = sizeof(short) * attr->name_len;