diff options
| author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-04-22 17:18:51 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-11 12:47:17 +0200 |
| commit | 850ef5d2393a053382c3d4618c9175415bf79dcb (patch) | |
| tree | 559aa060d2873e473428eda38f5d82a9ffb566aa | |
| parent | 3d32327f5cfc087ee3922a3bcdcc29880dcdb50f (diff) | |
| download | linux-850ef5d2393a053382c3d4618c9175415bf79dcb.tar.gz linux-850ef5d2393a053382c3d4618c9175415bf79dcb.tar.bz2 linux-850ef5d2393a053382c3d4618c9175415bf79dcb.zip | |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index d98cf7b382bc..2e4eea854bda 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -217,8 +217,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 */ |
