linux-stable/fs/exfat
Namjae Jeon c2fdf827f8 exfat: check if filename entries exceeds max filename length
[ Upstream commit d42334578e ]

exfat_extract_uni_name copies characters from a given file name entry into
the 'uniname' variable. This variable is actually defined on the stack of
the exfat_readdir() function. According to the definition of
the 'exfat_uni_name' type, the file name should be limited 255 characters
(+ null teminator space), but the exfat_get_uniname_from_ext_entry()
function can write more characters because there is no check if filename
entries exceeds max filename length. This patch add the check not to copy
filename characters when exceeding max filename length.

Cc: stable@vger.kernel.org
Cc: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reported-by: Maxim Suhanov <dfirblog@gmail.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-11 12:08:26 +02:00
..
balloc.c exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree 2023-08-11 12:08:19 +02:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: check if filename entries exceeds max filename length 2023-08-11 12:08:26 +02:00
exfat_fs.h exfat: redefine DIR_DELETED as the bad cluster number 2023-03-10 09:34:08 +01:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-22 09:55:13 +09:00
fatent.c exfat: fix overflow for large capacity partition 2022-09-04 09:38:40 +09:00
file.c exfat: fix inode->i_blocks for non-512 byte sector size device 2023-03-10 09:34:08 +01:00
inode.c exfat: fix inode->i_blocks for non-512 byte sector size device 2023-03-10 09:34:08 +01:00
Kconfig exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option 2020-06-09 16:48:39 +09:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
misc.c exfat: Expand exfat_err() and co directly to pr_*() macro 2022-08-01 10:14:07 +09:00
namei.c exfat: fix inode->i_blocks for non-512 byte sector size device 2023-03-10 09:34:08 +01:00
nls.c exfat: Drop superfluous new line for error messages 2022-08-01 10:14:07 +09:00
super.c exfat: fix inode->i_blocks for non-512 byte sector size device 2023-03-10 09:34:08 +01:00