public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 1/3] fs/ntfs3: Mark volume as dirty if xattr is broken
@ 2024-06-05 11:56 Sasha Levin
  2024-06-05 11:56 ` [PATCH AUTOSEL 6.1 2/3] cdrom: rearrange last_media_change check to avoid unintentional overflow Sasha Levin
  2024-06-05 11:56 ` [PATCH AUTOSEL 6.1 3/3] ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897 Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2024-06-05 11:56 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Konstantin Komarov, Sasha Levin, ntfs3

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

[ 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>
---
 fs/ntfs3/xattr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index d98cf7b382bcc..2e4eea854bda5 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 */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-05 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 11:56 [PATCH AUTOSEL 6.1 1/3] fs/ntfs3: Mark volume as dirty if xattr is broken Sasha Levin
2024-06-05 11:56 ` [PATCH AUTOSEL 6.1 2/3] cdrom: rearrange last_media_change check to avoid unintentional overflow Sasha Levin
2024-06-05 11:56 ` [PATCH AUTOSEL 6.1 3/3] ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897 Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox