syzbot


KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (11)

Status: moderation: reported on 2025/05/25 01:19
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+090227ea7a5578fc6b9c@syzkaller.appspotmail.com
First crash: 88d, last: 24d
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (8) exfat 6 1 543d 543d 0/29 auto-obsoleted due to no activity on 2024/03/30 16:35
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (4) ext4 6 5 1706d 1718d 0/29 auto-closed as invalid on 2021/01/23 11:44
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers exfat 6 8 2030d 2099d 0/29 auto-closed as invalid on 2020/04/08 22:27
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (3) exfat 6 10 1791d 1883d 0/29 auto-closed as invalid on 2020/10/29 18:32
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (7) exfat 6 42 593d 621d 0/29 auto-obsoleted due to no activity on 2024/02/03 09:04
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (2) exfat 6 1 1921d 1921d 0/29 closed as invalid on 2020/06/18 14:13
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (9) exfat 6 44 307d 435d 0/29 auto-obsoleted due to no activity on 2024/11/21 22:27
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (6) exfat 6 174 714d 1356d 0/29 auto-obsoleted due to no activity on 2023/10/11 19:19
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (5) exfat 6 32 1396d 1623d 0/29 auto-closed as invalid on 2021/11/29 11:14
upstream KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers (10) exfat 6 57 151d 236d 0/29 auto-obsoleted due to no activity on 2025/05/10 19:27

Sample crash report:
==================================================================
BUG: KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers

write to 0xffff88810a6b2c88 of 8 bytes by task 26526 on cpu 0:
 __remove_assoc_queue fs/buffer.c:523 [inline]
 fsync_buffers_list fs/buffer.c:796 [inline]
 sync_mapping_buffers+0x163/0x7d0 fs/buffer.c:584
 fat_file_fsync+0xaa/0x100 fs/fat/file.c:195
 vfs_fsync_range+0x10a/0x130 fs/sync.c:187
 generic_write_sync include/linux/fs.h:3031 [inline]
 generic_file_write_iter+0x1b8/0x2f0 mm/filemap.c:4259
 do_iter_readv_writev+0x421/0x4c0 fs/read_write.c:-1
 vfs_writev+0x2df/0x8b0 fs/read_write.c:1057
 do_pwritev fs/read_write.c:1153 [inline]
 __do_sys_pwritev2 fs/read_write.c:1211 [inline]
 __se_sys_pwritev2+0xfc/0x1c0 fs/read_write.c:1202
 __x64_sys_pwritev2+0x67/0x80 fs/read_write.c:1202
 x64_sys_call+0x1cea/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:329
 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 0xffff88810a6b2c88 of 8 bytes by task 26524 on cpu 1:
 mark_buffer_dirty_inode+0x95/0x1c0 fs/buffer.c:689
 fat_mirror_bhs+0x234/0x320 fs/fat/fatent.c:398
 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+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
 cont_expand_zero fs/buffer.c:2528 [inline]
 cont_write_begin+0x1b0/0x970 fs/buffer.c:2591
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:228
 generic_cont_expand_simple+0xad/0x150 fs/buffer.c:2492
 fat_cont_expand+0x3e/0x170 fs/fat/file.c:223
 fat_setattr+0x2a5/0x8a0 fs/fat/file.c:513
 notify_change+0x809/0x890 fs/attr.c:552
 do_truncate fs/open.c:68 [inline]
 do_ftruncate+0x34b/0x450 fs/open.c:195
 do_sys_ftruncate fs/open.c:210 [inline]
 __do_sys_ftruncate fs/open.c:215 [inline]
 __se_sys_ftruncate fs/open.c:213 [inline]
 __x64_sys_ftruncate+0x68/0xc0 fs/open.c:213
 x64_sys_call+0xd65/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:78
 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: 0xffff88810a551a08 -> 0x0000000000000000

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

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/28 01:55 upstream b711733e89a3 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers
2025/06/23 08:07 upstream b67ec639010f d6cdfb8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers
2025/06/10 14:00 upstream f09079bd04a9 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers
2025/05/25 01:18 upstream b1427432d3b6 ed351ea7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mark_buffer_dirty_inode / sync_mapping_buffers
* Struck through repros no longer work on HEAD.