Skip to content

Commit

Permalink
fs/ntfs3: Fixed overflow check in mi_enum_attr()
Browse files Browse the repository at this point in the history
[ Upstream commit 652cfeb ]

Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
aalexandrovich authored and gregkh committed Mar 1, 2024
1 parent eac2e00 commit 8c77398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ntfs3/record.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8c77398

Please sign in to comment.