diff options
| author | Pengpeng Hou <pengpeng@iscas.ac.cn> | 2026-03-27 14:19:55 +0800 |
|---|---|---|
| committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2026-04-07 18:43:40 +0200 |
| commit | a6cd43fe9b083fa23fe1595666d5738856cb261a (patch) | |
| tree | 433922ee0afb8b3f55ad1b6aaa411c780dd2eccf /include/linux/i2c/git@git.tavy.me:linux-stable.git | |
| parent | d1062683bf6b560b31f287eb0ebde4841bc72376 (diff) | |
fs/ntfs3: terminate the cached volume label after UTF-8 conversion
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: 82cae269cfa9 ("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>
Diffstat (limited to 'include/linux/i2c/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
