syzbot


KCSAN: data-race in fat12_ent_put / fat_mirror_bhs

Status: moderation: reported on 2025/05/07 08:24
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+12c2c86e32608a79d41c@syzkaller.appspotmail.com
First crash: 1d06h, last: 21h46m

Sample crash report:
loop5: detected capacity change from 0 to 8192
==================================================================
BUG: KCSAN: data-race in fat12_ent_put / fat_mirror_bhs

read-write to 0xffff8881336f1453 of 1 bytes by task 8046 on cpu 1:
 fat12_ent_put+0xc4/0x170 fs/fat/fatent.c:165
 fat_alloc_clusters+0x4ce/0xa80 fs/fat/fatent.c:503
 fat_add_cluster fs/fat/inode.c:107 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x258/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x419/0xf70 fs/buffer.c:2151
 block_write_begin fs/buffer.c:2262 [inline]
 cont_write_begin+0x5a3/0x8e0 fs/buffer.c:2601
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x181/0x490 mm/filemap.c:4103
 __generic_file_write_iter+0x9e/0x120 mm/filemap.c:4220
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4246
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x49d/0x8d0 fs/read_write.c:684
 ksys_write+0xda/0x1a0 fs/read_write.c:736
 __do_sys_write fs/read_write.c:747 [inline]
 __se_sys_write fs/read_write.c:744 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:744
 x64_sys_call+0x2cdd/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881336f1400 of 512 bytes by task 8032 on cpu 0:
 fat_mirror_bhs+0x1df/0x320 fs/fat/fatent.c:395
 fat_ent_write+0xd0/0xe0 fs/fat/fatent.c:423
 fat_chain_add+0x15b/0x3f0 fs/fat/misc.c:136
 fat_add_cluster fs/fat/inode.c:112 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x46c/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x419/0xf70 fs/buffer.c:2151
 block_write_begin fs/buffer.c:2262 [inline]
 cont_write_begin+0x5a3/0x8e0 fs/buffer.c:2601
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x181/0x490 mm/filemap.c:4103
 __generic_file_write_iter+0x9e/0x120 mm/filemap.c:4220
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4246
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x49d/0x8d0 fs/read_write.c:684
 ksys_write+0xda/0x1a0 fs/read_write.c:736
 __do_sys_write fs/read_write.c:747 [inline]
 __se_sys_write fs/read_write.c:744 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:744
 x64_sys_call+0x2cdd/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 8032 Comm: syz.5.1518 Not tainted 6.15.0-rc5-syzkaller-00038-g707df3375124 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/07 16:39 upstream 707df3375124 350f4ffc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fat12_ent_put / fat_mirror_bhs
2025/05/07 08:24 upstream 0d8d44db295c 350f4ffc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fat12_ent_put / fat_mirror_bhs
2025/05/07 08:24 upstream 0d8d44db295c 350f4ffc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fat12_ent_put / fat_mirror_bhs
* Struck through repros no longer work on HEAD.