syzbot


KCSAN: data-race in __mod_timer / kvfree_call_rcu

Status: fixed on 2024/12/16 09:50
Subsystems: rcu
[Documentation on labels]
Reported-by: syzbot+061d370693bdd99f9d34@syzkaller.appspotmail.com
Fix commit: a23da88c6c80 rcu/kvfree: Fix data-race in __mod_timer / kvfree_call_rcu
First crash: 73d, last: 32d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 8/8] rcu/kvfree: Fix data-race in __mod_timer / kvfree_call_rcu 1 (1) 2024/11/06 14:59
[PATCH] rcu/kvfree: Fix data-race in __mod_timer / kvfree_call_rcu 2 (2) 2024/10/23 15:56
[syzbot] [bpf?] KCSAN: data-race in __mod_timer / kvfree_call_rcu 4 (5) 2024/10/21 16:01

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

read to 0xffff888237c1cce8 of 8 bytes by task 8478 on cpu 0:
 schedule_delayed_monitor_work kernel/rcu/tree.c:3520 [inline]
 kvfree_call_rcu+0x3b8/0x510 kernel/rcu/tree.c:3839
 trie_update_elem+0x47c/0x620 kernel/bpf/lpm_trie.c:441
 bpf_map_update_value+0x324/0x350 kernel/bpf/syscall.c:203
 generic_map_update_batch+0x401/0x520 kernel/bpf/syscall.c:1849
 bpf_map_do_batch+0x28c/0x3f0 kernel/bpf/syscall.c:5162
 __sys_bpf+0x2e5/0x7a0
 __do_sys_bpf kernel/bpf/syscall.c:5760 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5758 [inline]
 __x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5758
 x64_sys_call+0x2625/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

write to 0xffff888237c1cce8 of 8 bytes by task 36 on cpu 1:
 __mod_timer+0x578/0x7f0 kernel/time/timer.c:1173
 add_timer_global+0x51/0x70 kernel/time/timer.c:1330
 __queue_delayed_work+0x127/0x1a0 kernel/workqueue.c:2523
 queue_delayed_work_on+0xdf/0x190 kernel/workqueue.c:2552
 queue_delayed_work include/linux/workqueue.h:677 [inline]
 schedule_delayed_monitor_work kernel/rcu/tree.c:3525 [inline]
 kfree_rcu_monitor+0x5e8/0x660 kernel/rcu/tree.c:3643
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3310
 worker_thread+0x51d/0x6f0 kernel/workqueue.c:3391
 kthread+0x1d1/0x210 kernel/kthread.c:389
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 36 Comm: kworker/u8:2 Not tainted 6.12.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events_unbound kfree_rcu_monitor
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/18 14:39 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / kvfree_call_rcu
2024/11/17 08:57 upstream b5a24181e461 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / kvfree_call_rcu
2024/10/30 19:23 upstream 4236f913808c fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / kvfree_call_rcu
2024/10/20 23:04 upstream 715ca9dd687f cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / kvfree_call_rcu
2024/10/08 22:33 upstream 5b7c893ed5ed 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_timer / kvfree_call_rcu
* Struck through repros no longer work on HEAD.