diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-01-26 11:14:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-01 15:34:54 +0300 |
commit | 8c77398c72618101d66480b94b34fe9087ee3d08 (patch) | |
tree | 6e9852c4c11c6fe84535693e6800b88d7ed24fa2 /fs | |
parent | eac2e00f3c315d5979b23431cd4e3be4d913cd41 (diff) | |
download | linux-8c77398c72618101d66480b94b34fe9087ee3d08.tar.xz |
fs/ntfs3: Fixed overflow check in mi_enum_attr()
[ Upstream commit 652cfeb43d6b9aba5c7c4902bed7a7340df131fb ]
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ntfs3/record.c | 2 |
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; |