summaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-01-26 11:14:31 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-01-29 10:48:34 +0300
commit652cfeb43d6b9aba5c7c4902bed7a7340df131fb (patch)
tree0331b323880fd8f219ed768bcc4d1fb2b1318706 /fs/ntfs3
parent1b7dd28e14c4728ae1a815605ca33ffb4ce1b309 (diff)
downloadlinux-652cfeb43d6b9aba5c7c4902bed7a7340df131fb.tar.xz
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>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/record.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c
index 7b6423584eae..6aa3a9d44df1 100644
--- a/fs/ntfs3/record.c
+++ b/fs/ntfs3/record.c
@@ -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;