summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-04-22 17:18:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-11 12:51:20 +0200
commitd7aeca648788f417953ea9c9834740e8731c82c2 (patch)
tree6e3950e16d16b24aa3b5332176b2b75bb1e1e8bb
parent27cd3873fa76ebeb9f948baae40cb9a6d8692289 (diff)
fs/ntfs3: Mark volume as dirty if xattr is broken
[ Upstream commit 24f6f5020b0b2c89c2cba5ec224547be95f753ee ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/ntfs3/xattr.c5
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 */