summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-01-26 09:14:31 +0100
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-01-29 08:48:34 +0100
commit652cfeb43d6b9aba5c7c4902bed7a7340df131fb (patch)
tree0331b323880fd8f219ed768bcc4d1fb2b1318706 /fs
parentfs/ntfs3: Correct function is_rst_area_valid (diff)
downloadlinux-652cfeb43d6b9aba5c7c4902bed7a7340df131fb.tar.xz
linux-652cfeb43d6b9aba5c7c4902bed7a7340df131fb.zip
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')
-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;