linux/fs/exfat
Namjae Jeon 88fc3dd6e6 exfat: fix divide-by-zero in exfat_allocate_bitmap
[ Upstream commit d70a5804c5 ]

The variable max_ra_count can be 0 in exfat_allocate_bitmap(),
which causes a divide-by-zero error in the subsequent modulo operation
(i % max_ra_count), leading to a system crash.
When max_ra_count is 0, it means that readahead is not used. This patch
load the bitmap without readahead.

Fixes: 9fd688678d ("exfat: optimize allocation bitmap loading time")
Reported-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 14:03:31 +01:00
..
balloc.c exfat: fix divide-by-zero in exfat_allocate_bitmap 2025-12-18 14:03:31 +01: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: fix out-of-bounds in exfat_nls_to_ucs2() 2025-10-15 17:53:20 +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: fix out-of-bounds in exfat_nls_to_ucs2() 2025-10-15 17:53:20 +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 refcount leak in exfat_find 2025-12-18 14:03:31 +01:00
nls.c exfat: fix out-of-bounds in exfat_nls_to_ucs2() 2025-10-15 17:53:20 +09:00
super.c exfat: check return value of sb_min_blocksize in exfat_read_boot_sector 2025-11-05 14:00:16 +01:00