syzbot


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

Status: upstream: reported on 2025/01/27 08:10
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+87ab99ec8b81ae79bae2@syzkaller.appspotmail.com
First crash: 13d, last: 13d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [block?] KCSAN: data-race in __mod_timer / blk_add_timer (10) 0 (1) 2025/01/27 08:10
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __mod_timer / blk_add_timer (6) block 1 672d 652d 0/28 auto-obsoleted due to no activity on 2023/05/09 08:21
upstream KCSAN: data-race in __mod_timer / blk_add_timer block 2 1356d 1390d 0/28 auto-closed as invalid on 2021/06/25 00:11
upstream KCSAN: data-race in __mod_timer / blk_add_timer (3) block 8 1131d 1229d 0/28 auto-closed as invalid on 2022/02/04 22:18
upstream KCSAN: data-race in __mod_timer / blk_add_timer (2) block 2 1281d 1311d 0/28 auto-closed as invalid on 2021/09/07 18:24
upstream KCSAN: data-race in __mod_timer / blk_add_timer (4) block 2 1038d 1057d 0/28 auto-closed as invalid on 2022/05/08 11:46
upstream KCSAN: data-race in __mod_timer / blk_add_timer (7) block 2 592d 609d 0/28 auto-obsoleted due to no activity on 2023/07/28 08:54
upstream KCSAN: data-race in __mod_timer / blk_add_timer (5) block 1 894d 894d 0/28 auto-closed as invalid on 2022/09/29 13:43
upstream KCSAN: data-race in __mod_timer / blk_add_timer (9) block 1 235d 235d 0/28 auto-obsoleted due to no activity on 2024/07/19 18:23
upstream KCSAN: data-race in __mod_timer / blk_add_timer (8) block 7 385d 423d 0/28 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 0xffff8881026b9c00 of 8 bytes by task 4008 on cpu 1:
 __mod_timer+0x578/0x7f0 kernel/time/timer.c:1172
 mod_timer+0x1f/0x30 kernel/time/timer.c:1241
 blk_add_timer+0x17e/0x190 block/blk-timeout.c:164
 blk_mq_start_request+0x185/0x3b0 block/blk-mq.c:1351
 scsi_queue_rq+0x14aa/0x1a10 drivers/scsi/scsi_lib.c:1846
 blk_mq_dispatch_rq_list+0x630/0xfa0 block/blk-mq.c:2120
 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:170 [inline]
 blk_mq_do_dispatch_sched block/blk-mq-sched.c:184 [inline]
 __blk_mq_sched_dispatch_requests+0x604/0xd50 block/blk-mq-sched.c:309
 blk_mq_sched_dispatch_requests+0x88/0x120 block/blk-mq-sched.c:331
 blk_mq_run_hw_queue+0x18a/0x230 block/blk-mq.c:2354
 blk_mq_flush_plug_list+0xbd5/0xef0 block/blk-mq.c:2917
 __blk_flush_plug+0x216/0x290 block/blk-core.c:1214
 blk_finish_plug+0x48/0x70 block/blk-core.c:1241
 swap_cluster_readahead+0x342/0x3f0 mm/swap_state.c:698
 swapin_readahead+0xe4/0x6f0 mm/swap_state.c:882
 do_swap_page+0x31b/0x2550 mm/memory.c:4341
 handle_pte_fault mm/memory.c:5804 [inline]
 __handle_mm_fault mm/memory.c:5944 [inline]
 handle_mm_fault+0x8e4/0x2ac0 mm/memory.c:6112
 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
 __get_user_8+0x18/0x30 arch/x86/lib/getuser.S:98
 fetch_robust_entry kernel/futex/core.c:762 [inline]
 exit_robust_list+0x31/0x280 kernel/futex/core.c:790
 futex_cleanup kernel/futex/core.c:1022 [inline]
 futex_exit_release+0xe3/0x130 kernel/futex/core.c:1123
 exit_mm_release+0x1a/0x30 kernel/fork.c:1655
 exit_mm+0x38/0x190 kernel/exit.c:543
 do_exit+0x559/0x17f0 kernel/exit.c:925
 do_group_exit+0x102/0x150 kernel/exit.c:1087
 get_signal+0xeb9/0x1000 kernel/signal.c:3036
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x62/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881026b9c00 of 8 bytes by task 4015 on cpu 0:
 blk_add_timer+0x112/0x190
 blk_mq_start_request+0x185/0x3b0 block/blk-mq.c:1351
 scsi_queue_rq+0x14aa/0x1a10 drivers/scsi/scsi_lib.c:1846
 blk_mq_dispatch_rq_list+0x630/0xfa0 block/blk-mq.c:2120
 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:170 [inline]
 blk_mq_do_dispatch_sched block/blk-mq-sched.c:184 [inline]
 __blk_mq_sched_dispatch_requests+0x604/0xd50 block/blk-mq-sched.c:309
 blk_mq_sched_dispatch_requests+0x88/0x120 block/blk-mq-sched.c:331
 blk_mq_run_hw_queue+0x18a/0x230 block/blk-mq.c:2354
 blk_mq_flush_plug_list+0xbd5/0xef0 block/blk-mq.c:2917
 __blk_flush_plug+0x216/0x290 block/blk-core.c:1214
 blk_finish_plug+0x48/0x70 block/blk-core.c:1241
 swap_cluster_readahead+0x342/0x3f0 mm/swap_state.c:698
 swapin_readahead+0xe4/0x6f0 mm/swap_state.c:882
 do_swap_page+0x31b/0x2550 mm/memory.c:4341
 handle_pte_fault mm/memory.c:5804 [inline]
 __handle_mm_fault mm/memory.c:5944 [inline]
 handle_mm_fault+0x8e4/0x2ac0 mm/memory.c:6112
 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
 __get_user_8+0x18/0x30 arch/x86/lib/getuser.S:98
 fetch_robust_entry kernel/futex/core.c:762 [inline]
 exit_robust_list+0x31/0x280 kernel/futex/core.c:790
 futex_cleanup kernel/futex/core.c:1022 [inline]
 futex_exit_release+0xe3/0x130 kernel/futex/core.c:1123
 exit_mm_release+0x1a/0x30 kernel/fork.c:1655
 exit_mm+0x38/0x190 kernel/exit.c:543
 do_exit+0x559/0x17f0 kernel/exit.c:925
 do_group_exit+0x102/0x150 kernel/exit.c:1087
 get_signal+0xeb9/0x1000 kernel/signal.c:3036
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x62/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000ffff9e3f -> 0x00000000ffffa0d4

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 4015 Comm: syz.1.204 Not tainted 6.13.0-syzkaller-01005-gb9d8a295ed6b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/22 05:58 upstream b9d8a295ed6b da72ac06 .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.