diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-04-22 16:18:51 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-04-23 08:34:25 +0200 |
commit | 24f6f5020b0b2c89c2cba5ec224547be95f753ee (patch) | |
tree | 20ee20aeb38c975c7be566506c98e5619455f16b | |
parent | fs/ntfs3: Always make file nonresident on fallocate call (diff) | |
download | linux-24f6f5020b0b2c89c2cba5ec224547be95f753ee.tar.xz linux-24f6f5020b0b2c89c2cba5ec224547be95f753ee.zip |
fs/ntfs3: Mark volume as dirty if xattr is broken
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>
-rw-r--r-- | fs/ntfs3/xattr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 53e7d1fa036a..73785dece7a7 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -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 */ |