syzbot


KCSAN: data-race in __mod_timer / blk_add_timer (12)

Status: moderation: reported on 2025/07/26 12:53
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+d148993d55f8ebb8959c@syzkaller.appspotmail.com
First crash: 33d, last: 3d23h
Similar bugs (11)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __mod_timer / blk_add_timer (6) block 6 1 877d 857d 0/29 auto-obsoleted due to no activity on 2023/05/09 08:21
upstream KCSAN: data-race in __mod_timer / blk_add_timer (10) block 6 1 218d 213d 0/29 auto-obsoleted due to no activity on 2025/03/19 05:59
upstream KCSAN: data-race in __mod_timer / blk_add_timer (11) block 6 3 121d 158d 0/29 auto-obsoleted due to no activity on 2025/06/24 14:35
upstream KCSAN: data-race in __mod_timer / blk_add_timer block 6 2 1561d 1595d 0/29 auto-closed as invalid on 2021/06/25 00:11
upstream KCSAN: data-race in __mod_timer / blk_add_timer (3) block 6 8 1336d 1434d 0/29 auto-closed as invalid on 2022/02/04 22:18
upstream KCSAN: data-race in __mod_timer / blk_add_timer (2) block 6 2 1486d 1516d 0/29 auto-closed as invalid on 2021/09/07 18:24
upstream KCSAN: data-race in __mod_timer / blk_add_timer (4) block 6 2 1243d 1262d 0/29 auto-closed as invalid on 2022/05/08 11:46
upstream KCSAN: data-race in __mod_timer / blk_add_timer (7) block 6 2 797d 814d 0/29 auto-obsoleted due to no activity on 2023/07/28 08:54
upstream KCSAN: data-race in __mod_timer / blk_add_timer (5) block 6 1 1099d 1099d 0/29 auto-closed as invalid on 2022/09/29 13:43
upstream KCSAN: data-race in __mod_timer / blk_add_timer (9) block 6 1 440d 440d 0/29 auto-obsoleted due to no activity on 2024/07/19 18:23
upstream KCSAN: data-race in __mod_timer / blk_add_timer (8) block 6 7 590d 628d 0/29 auto-obsoleted due to no activity on 2024/02/20 17:38

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __mod_timer / blk_add_timer

write to 0xffff8881016edc48 of 8 bytes by task 26138 on cpu 0:
 __mod_timer+0x5a1/0x840 kernel/time/timer.c:1126
 mod_timer+0x1f/0x30 kernel/time/timer.c:1195
 blk_add_timer+0x182/0x1a0 block/blk-timeout.c:164
 blk_mq_start_request+0x183/0x3d0 block/blk-mq.c:1357
 loop_queue_rq+0x43/0x680 drivers/block/loop.c:1850
 __blk_mq_issue_directly block/blk-mq.c:2695 [inline]
 blk_mq_request_issue_directly+0x1e6/0x380 block/blk-mq.c:2782
 blk_mq_issue_direct+0x19d/0x530 block/blk-mq.c:2803
 blk_mq_dispatch_queue_requests+0x1fc/0x350 block/blk-mq.c:2878
 blk_mq_flush_plug_list+0x2b6/0x330 block/blk-mq.c:2961
 __blk_flush_plug+0x222/0x2a0 block/blk-core.c:1220
 blk_finish_plug block/blk-core.c:1247 [inline]
 __submit_bio+0x2fc/0x4d0 block/blk-core.c:649
 __submit_bio_noacct_mq block/blk-core.c:722 [inline]
 submit_bio_noacct_nocheck+0x208/0x6a0 block/blk-core.c:751
 submit_bio_noacct+0x6ed/0x920 block/blk-core.c:874
 submit_bio+0x2a6/0x2c0 block/blk-core.c:916
 submit_bh_wbc+0x2e0/0x320 fs/buffer.c:2824
 submit_bh fs/buffer.c:2829 [inline]
 __sync_dirty_buffer+0x16b/0x230 fs/buffer.c:2867
 sync_dirty_buffer+0x1a/0x30 fs/buffer.c:2880
 fat_mirror_bhs+0x270/0x320 fs/fat/fatent.c:400
 fat_alloc_clusters+0x98b/0xa80 fs/fat/fatent.c:543
 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+0x3fd/0xf90 fs/buffer.c:2145
 block_write_begin fs/buffer.c:2256 [inline]
 cont_write_begin+0x5fc/0x970 fs/buffer.c:2594
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:229
 generic_perform_write+0x184/0x490 mm/filemap.c:4175
 __generic_file_write_iter+0x9e/0x120 mm/filemap.c:4292
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4318
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x52a/0x960 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+0x27fe/0x2ff0 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 0xffff8881016edc48 of 8 bytes by task 26146 on cpu 1:
 blk_add_timer+0x115/0x1a0 block/blk-timeout.c:-1
 blk_mq_start_request+0x183/0x3d0 block/blk-mq.c:1357
 loop_queue_rq+0x43/0x680 drivers/block/loop.c:1850
 __blk_mq_issue_directly block/blk-mq.c:2695 [inline]
 blk_mq_request_issue_directly+0x1e6/0x380 block/blk-mq.c:2782
 blk_mq_issue_direct+0x19d/0x530 block/blk-mq.c:2803
 blk_mq_dispatch_queue_requests+0x1fc/0x350 block/blk-mq.c:2878
 blk_mq_flush_plug_list+0x2b6/0x330 block/blk-mq.c:2961
 __blk_flush_plug+0x222/0x2a0 block/blk-core.c:1220
 blk_finish_plug block/blk-core.c:1247 [inline]
 __submit_bio+0x2fc/0x4d0 block/blk-core.c:649
 __submit_bio_noacct_mq block/blk-core.c:722 [inline]
 submit_bio_noacct_nocheck+0x208/0x6a0 block/blk-core.c:751
 submit_bio_noacct+0x6ed/0x920 block/blk-core.c:874
 submit_bio+0x2a6/0x2c0 block/blk-core.c:916
 submit_bh_wbc+0x2e0/0x320 fs/buffer.c:2824
 submit_bh fs/buffer.c:2829 [inline]
 write_dirty_buffer+0xee/0x120 fs/buffer.c:2842
 fat_sync_bhs+0x49/0x130 fs/fat/misc.c:367
 fat_ent_write+0x91/0xe0 fs/fat/fatent.c:419
 fat_chain_add+0x15d/0x440 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+0x3fd/0xf90 fs/buffer.c:2145
 block_write_begin fs/buffer.c:2256 [inline]
 cont_write_begin+0x5fc/0x970 fs/buffer.c:2594
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:229
 generic_perform_write+0x184/0x490 mm/filemap.c:4175
 __generic_file_write_iter+0x9e/0x120 mm/filemap.c:4292
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4318
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x52a/0x960 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+0x27fe/0x2ff0 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

value changed: 0x000000010000b3b8 -> 0x000000010000aa75

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 26146 Comm: syz.7.7231 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/25 05:32 upstream 69fd6b99b8f8 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / blk_add_timer
2025/08/20 05:43 upstream b19a97d57c15 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / blk_add_timer
2025/07/26 12:52 upstream 5f33ebd2018c fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / blk_add_timer
* Struck through repros no longer work on HEAD.