Files
linux-stable-mirror/fs
Pengpeng Hou 0b11fcbe80 fs/ntfs3: terminate the cached volume label after UTF-8 conversion
[ Upstream commit a6cd43fe9b ]

ntfs_fill_super() loads the on-disk volume label with utf16s_to_utf8s()
and stores the result in sbi->volume.label. The converted label is later
exposed through ntfs3_label_show() using %s, but utf16s_to_utf8s() only
returns the number of bytes written and does not add a trailing NUL.

If the converted label fills the entire fixed buffer,
ntfs3_label_show() can read past the end of sbi->volume.label while
looking for a terminator.

Terminate the cached label explicitly after a successful conversion and
clamp the exact-full case to the last byte of the buffer.

Fixes: 82cae269cf ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-05-23 13:03:21 +02:00
..
2026-03-04 07:20:43 -05:00
2026-01-11 15:22:23 +01:00
2026-01-17 16:30:00 +01:00
2025-03-22 12:50:41 -07:00
2025-10-29 14:06:59 +01:00
2026-01-11 15:22:23 +01:00
2026-04-06 09:55:59 +02:00