linux/fs/exfat
Jaehun Gou 6c627bcc18 exfat: fix improper check of dentry.stream.valid_size
[ Upstream commit 82ebecdc74 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-11-24 10:35:48 +01:00
..
balloc.c exfat: validate cluster allocation bits of the allocation bitmap 2025-11-13 15:34:31 -05:00
cache.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
dir.c exfat: add cluster chain loop check for dir 2025-08-20 18:30:47 +02:00
exfat_fs.h exfat: fix soft lockup in exfat_clear_bitmap 2025-03-13 13:02:08 +01:00
exfat_raw.h exfat: add ioctls for accessing attributes 2023-10-31 10:00:51 +09:00
fatent.c exfat: limit log print for IO error 2025-11-13 15:34:31 -05:00
file.c exfat: fdatasync flag should be same like generic_write_sync() 2025-08-15 12:14:02 +02:00
inode.c exfat: call bh_read in get_block only when necessary 2025-05-29 11:02:03 +02: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-11-24 10:35:48 +01:00
nls.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
super.c exfat: add cluster chain loop check for dir 2025-08-20 18:30:47 +02:00