syzbot


KCSAN: data-race in fat32_ent_get / fat32_ent_put

Status: upstream: reported on 2025/07/28 08:17
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+d3c29ed63db6ddf8406e@syzkaller.appspotmail.com
First crash: 30d, last: 30d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] fat: Prevent the race of read/write the FAT16 and FAT32 entry 14 (14) 2025/08/18 13:58
[syzbot] [exfat?] KCSAN: data-race in fat32_ent_get / fat32_ent_put 0 (1) 2025/07/28 08:17

Sample crash report:
==================================================================
BUG: KCSAN: data-race in fat32_ent_get / fat32_ent_put

read-write to 0xffff88810b7b319c of 4 bytes by task 7231 on cpu 0:
 fat32_ent_put+0x4e/0x90 fs/fat/fatent.c:191
 fat_ent_write+0x6c/0xe0 fs/fat/fatent.c:417
 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+0x400/0xf90 fs/buffer.c:2151
 block_write_begin fs/buffer.c:2262 [inline]
 cont_write_begin+0x5fc/0x970 fs/buffer.c:2601
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x184/0x490 mm/filemap.c:4112
 __generic_file_write_iter+0xec/0x120 mm/filemap.c:4226
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4255
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x4a0/0x8e0 fs/read_write.c:686
 ksys_write+0xda/0x1a0 fs/read_write.c:738
 __do_sys_write fs/read_write.c:749 [inline]
 __se_sys_write fs/read_write.c:746 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:746
 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+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88810b7b319c of 4 bytes by task 7250 on cpu 1:
 fat32_ent_get+0x24/0x80 fs/fat/fatent.c:149
 fat_count_free_clusters+0x50e/0x760 fs/fat/fatent.c:741
 fat_statfs+0xc0/0x200 fs/fat/inode.c:834
 statfs_by_dentry fs/statfs.c:66 [inline]
 vfs_statfs+0xc8/0x1c0 fs/statfs.c:90
 user_statfs+0x71/0x110 fs/statfs.c:105
 __do_sys_statfs fs/statfs.c:193 [inline]
 __se_sys_statfs fs/statfs.c:190 [inline]
 __x64_sys_statfs+0x65/0xf0 fs/statfs.c:190
 x64_sys_call+0x1edd/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:138
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0fffffff -> 0x00000068

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 7250 Comm: syz.4.1276 Not tainted 6.16.0-rc7-syzkaller-00140-gec2df4364666 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/27 11:21 upstream ec2df4364666 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fat32_ent_get / fat32_ent_put
* Struck through repros no longer work on HEAD.