]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:33 +0000 (15:37 -0500)
commit13c1d24803d5b0446b3f6f0fdd67e07ac1fdc7bf
tree07417598fe457f4c00b23fe45371e47c6762c6e1
parent6a7bbbb2892711489a613f7abc5aba6e786e8428
exfat: validate cluster allocation bits of the allocation bitmap

[ Upstream commit 79c1587b6cda74deb0c86fc7ba194b92958c793c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/exfat/balloc.c