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: 104d, last: 34d
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 948d 928d 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 289d 284d 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 192d 228d 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 1631d 1666d 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 1406d 1505d 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 1557d 1587d 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 1314d 1333d 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 868d 885d 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 1170d 1170d 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 511d 511d 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 661d 698d 0/29 auto-obsoleted due to no activity on 2024/02/20 17:38

Sample crash report:
loop7: detected capacity change from 0 to 8192
==================================================================
BUG: KCSAN: data-race in __mod_timer / blk_add_timer

write to 0xffff8881023e94a8 of 8 bytes by task 82 on cpu 0:
 __mod_timer+0x5a1/0x840 kernel/time/timer.c:1126
 mod_timer+0x1f/0x30 kernel/time/timer.c:1195
 blk_mq_timeout_work+0x177/0x340 block/blk-mq.c:1758
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0x4cb/0x9d0 kernel/workqueue.c:3346
 worker_thread+0x582/0x770 kernel/workqueue.c:3427
 kthread+0x486/0x510 kernel/kthread.c:463
 ret_from_fork+0x11f/0x1b0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff8881023e94a8 of 8 bytes by task 8540 on cpu 1:
 blk_add_timer+0x115/0x1a0 block/blk-timeout.c:-1
 blk_mq_start_request+0x183/0x3d0 block/blk-mq.c:1366
 loop_queue_rq+0x43/0x680 drivers/block/loop.c:1856
 __blk_mq_issue_directly block/blk-mq.c:2704 [inline]
 blk_mq_request_issue_directly+0x1e9/0x380 block/blk-mq.c:2791
 blk_mq_issue_direct+0x19d/0x530 block/blk-mq.c:2812
 blk_mq_dispatch_queue_requests+0x1fc/0x350 block/blk-mq.c:2887
 blk_mq_flush_plug_list+0x2b6/0x330 block/blk-mq.c:2970
 __blk_flush_plug+0x222/0x2a0 block/blk-core.c:1225
 blk_finish_plug block/blk-core.c:1252 [inline]
 __submit_bio+0x2fc/0x4d0 block/blk-core.c:651
 __submit_bio_noacct_mq block/blk-core.c:724 [inline]
 submit_bio_noacct_nocheck+0x152/0x5c0 block/blk-core.c:755
 submit_bio_noacct+0x746/0x9a0 block/blk-core.c:879
 submit_bio+0x2a6/0x2c0 block/blk-core.c:921
 submit_bh_wbc+0x2e0/0x320 fs/buffer.c:2824
 submit_bh fs/buffer.c:2829 [inline]
 __bread_slow fs/buffer.c:1272 [inline]
 __bread_gfp+0x15c/0x250 fs/buffer.c:1518
 sb_bread include/linux/buffer_head.h:346 [inline]
 fat__get_entry fs/fat/dir.c:100 [inline]
 fat_get_entry+0x46e/0x5d0 fs/fat/dir.c:128
 fat_get_short_entry fs/fat/dir.c:885 [inline]
 fat_subdirs+0xf6/0x190 fs/fat/dir.c:951
 fat_read_root+0x316/0x360 fs/fat/inode.c:1347
 fat_fill_super+0x15bf/0x1ce0 fs/fat/inode.c:1816
 vfat_fill_super+0x24/0x30 fs/fat/namei_vfat.c:1197
 get_tree_bdev_flags+0x28e/0x300 fs/super.c:1691
 get_tree_bdev+0x1f/0x30 fs/super.c:1714
 vfat_get_tree+0x1c/0x30 fs/fat/namei_vfat.c:1202
 vfs_get_tree+0x57/0x1d0 fs/super.c:1751
 fc_mount fs/namespace.c:1208 [inline]
 do_new_mount_fc fs/namespace.c:3651 [inline]
 do_new_mount+0x24d/0x660 fs/namespace.c:3727
 path_mount+0x4a5/0xb70 fs/namespace.c:4037
 do_mount fs/namespace.c:4050 [inline]
 __do_sys_mount fs/namespace.c:4238 [inline]
 __se_sys_mount+0x28c/0x2e0 fs/namespace.c:4215
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4215
 x64_sys_call+0x2b51/0x3000 arch/x86/include/generated/asm/syscalls_64.h:166
 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: 0x00000000ffffc174 -> 0x00000000ffffcab8

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

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/04 15:06 upstream cbf33b8e0b36 49379ee0 .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/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.