[SRU][J][PATCH 1/1] fs/ntfs3: Fixed overflow check in mi_enum_attr()

Massimiliano Pellizzer massimiliano.pellizzer at canonical.com
Mon Aug 4 17:19:17 UTC 2025


From: Konstantin Komarov <almaz.alexandrovich at paragon-software.com>

Reported-by: Robert Morris <rtm at csail.mit.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich at paragon-software.com>
(backported from commit 652cfeb43d6b9aba5c7c4902bed7a7340df131fb)
[mpellizzer: contexxt adjusted due to missing commit
 - 013ff63b6494 fs/ntfs3: Add more attributes checks in mi_enum_attr()
 which renamed some variables in the mi_enum_attr() function]
CVE-2024-27407
Signed-off-by: Massimiliano Pellizzer <massimiliano.pellizzer at canonical.com>
---
 fs/ntfs3/record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c
index 7c2c1b42cf9fb..dfe406afc45a0 100644
--- a/fs/ntfs3/record.c
+++ b/fs/ntfs3/record.c
@@ -261,7 +261,7 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
 			return NULL;
 
 		t32 = le32_to_cpu(attr->res.data_size);
-		if (t16 + t32 > asize)
+		if (t32 > asize - t16)
 			return NULL;
 
 		if (attr->name_len &&
-- 
2.48.1




More information about the kernel-team mailing list