]> www.infradead.org Git - nvme.git/commitdiff
fs/ntfs3: Mark volume as dirty if xattr is broken
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 22 Apr 2024 14:18:51 +0000 (17:18 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 23 Apr 2024 06:34:25 +0000 (09:34 +0300)
Mark a volume as corrupted if the name length exceeds the space
occupied by ea.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/xattr.c

index 53e7d1fa036aa6e50a3ccd529d88584b1350cd74..73785dece7a7fc5ced598d9fb392ab99bb799d43 100644 (file)
@@ -219,8 +219,11 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,
                if (!ea->name_len)
                        break;
 
-               if (ea->name_len > ea_size)
+               if (ea->name_len > ea_size) {
+                       ntfs_set_state(ni->mi.sbi, NTFS_DIRTY_ERROR);
+                       err = -EINVAL; /* corrupted fs */
                        break;
+               }
 
                if (buffer) {
                        /* Check if we can use field ea->name */