]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
exfat: validate cluster allocation bits of the allocation bitmap
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 30 Aug 2025 05:44:35 +0000 (14:44 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Tue, 30 Sep 2025 04:34:42 +0000 (13:34 +0900)
commit79c1587b6cda74deb0c86fc7ba194b92958c793c
tree313c01db9ecbe6c30ea5aeb61c1ddb1d4916b139
parent6dfba108387bf4e71411b3da90b2d5cce48ba054
exfat: validate cluster allocation bits of the allocation bitmap

syzbot created an exfat image with cluster bits not set for the allocation
bitmap. exfat-fs reads and uses the allocation bitmap without checking
this. The problem is that if the start cluster of the allocation bitmap
is 6, cluster 6 can be allocated when creating a directory with mkdir.
exfat zeros out this cluster in exfat_mkdir, which can delete existing
entries. This can reallocate the allocated entries. In addition,
the allocation bitmap is also zeroed out, so cluster 6 can be reallocated.
This patch adds exfat_test_bitmap_range to validate that clusters used for
the allocation bitmap are correctly marked as in-use.

Reported-by: syzbot+a725ab460fc1def9896f@syzkaller.appspotmail.com
Tested-by: syzbot+a725ab460fc1def9896f@syzkaller.appspotmail.com
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/balloc.c