linux/fs/exfat
Jaehun Gou 82ebecdc74 exfat: fix improper check of dentry.stream.valid_size
We found an infinite loop bug in the exFAT file system that can lead to a
Denial-of-Service (DoS) condition. When a dentry in an exFAT filesystem is
malformed, the following system calls — SYS_openat, SYS_ftruncate, and
SYS_pwrite64 — can cause the kernel to hang.

Root cause analysis shows that the size validation code in exfat_find()
does not check whether dentry.stream.valid_size is negative. As a result,
the system calls mentioned above can succeed and eventually trigger the DoS
issue.

This patch adds a check for negative dentry.stream.valid_size to prevent
this vulnerability.

Co-developed-by: Seunghun Han <kkamagui@gmail.com>
Signed-off-by: Seunghun Han <kkamagui@gmail.com>
Co-developed-by: Jihoon Kwon <jimmyxyz010315@gmail.com>
Signed-off-by: Jihoon Kwon <jimmyxyz010315@gmail.com>
Signed-off-by: Jaehun Gou <p22gone@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2025-10-15 14:37:21 +09:00
..
balloc.c exfat: optimize allocation bitmap loading time 2025-09-30 13:34:43 +09:00
cache.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
dir.c exfat: Add support for FS_IOC_{GET,SET}FSLABEL 2025-09-30 13:49:31 +09:00
exfat_fs.h exfat: Add support for FS_IOC_{GET,SET}FSLABEL 2025-09-30 13:49:31 +09:00
exfat_raw.h exfat: Add support for FS_IOC_{GET,SET}FSLABEL 2025-09-30 13:49:31 +09:00
fatent.c exfat: limit log print for IO error 2025-09-30 13:34:42 +09:00
file.c exfat: Add support for FS_IOC_{GET,SET}FSLABEL 2025-09-30 13:49:31 +09:00
inode.c exfat: drop redundant conversion to bool 2025-09-30 13:34:43 +09:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
misc.c exfat: convert to new timestamp accessors 2023-10-18 13:26:21 +02:00
namei.c exfat: fix improper check of dentry.stream.valid_size 2025-10-15 14:37:21 +09:00
nls.c exfat: Remove unnecessary parentheses 2025-09-30 13:34:43 +09:00
super.c exfat: combine iocharset and utf8 option setup 2025-09-30 13:41:22 +09:00