syzbot


KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 (5)

Status: moderation: reported on 2024/11/22 00:23
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+da965b944118a31a1521@syzkaller.appspotmail.com
First crash: 23h53m, last: 23h53m
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 (2) kernel 1 828d 828d 0/28 auto-closed as invalid on 2022/09/21 17:08
upstream KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 kernel 1 934d 934d 0/28 auto-closed as invalid on 2022/06/07 09:14
upstream KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 (4) kernel 1 50d 50d 0/28 auto-obsoleted due to no activity on 2024/11/07 19:03
upstream KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 (3) kernel 1 85d 85d 0/28 auto-obsoleted due to no activity on 2024/10/03 14:19

Sample crash report:
==================================================================
BUG: KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64

read-write to 0xffffffff866089c0 of 8 bytes by interrupt on cpu 0:
 tick_do_update_jiffies64+0x112/0x1b0 kernel/time/tick-sched.c:118
 tick_sched_do_timer kernel/time/tick-sched.c:232 [inline]
 tick_nohz_handler+0x7c/0x2d0 kernel/time/tick-sched.c:290
 __run_hrtimer kernel/time/hrtimer.c:1739 [inline]
 __hrtimer_run_queues+0x20d/0x5e0 kernel/time/hrtimer.c:1803
 hrtimer_interrupt+0x235/0x4a0 kernel/time/hrtimer.c:1865
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
 __sysvec_apic_timer_interrupt+0x5c/0x1d0 arch/x86/kernel/apic/apic.c:1055
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0x6e/0x80 arch/x86/kernel/apic/apic.c:1049
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 p9_client_rpc+0x322/0x710 net/9p/client.c:724
 p9_client_flush+0x15a/0x220 net/9p/client.c:609
 p9_client_rpc+0x59e/0x710 net/9p/client.c:741
 p9_client_create+0x6d8/0xaf0 net/9p/client.c:1036
 v9fs_session_init+0xf9/0xda0 fs/9p/v9fs.c:410
 v9fs_mount+0x69/0x570 fs/9p/vfs_super.c:122
 legacy_get_tree+0x77/0xd0 fs/fs_context.c:662
 vfs_get_tree+0x56/0x1e0 fs/super.c:1814
 do_new_mount+0x227/0x690 fs/namespace.c:3507
 path_mount+0x49b/0xb30 fs/namespace.c:3834
 do_mount fs/namespace.c:3847 [inline]
 __do_sys_mount fs/namespace.c:4057 [inline]
 __se_sys_mount+0x27c/0x2d0 fs/namespace.c:4034
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4034
 x64_sys_call+0x2c84/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:166
 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

read to 0xffffffff866089c0 of 8 bytes by task 11939 on cpu 1:
 do_flush_stats mm/memcontrol.c:594 [inline]
 flush_memcg_stats_dwork+0x26/0x90 mm/memcontrol.c:633
 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

value changed: 0x0000000100013639 -> 0x000000010001363a

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 11939 Comm: kworker/u8:52 Tainted: G        W          6.12.0-syzkaller-03657-g43fb83c17ba2 #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024
Workqueue: events_unbound flush_memcg_stats_dwork
==================================================================
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/22 00:22 upstream 43fb83c17ba2 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64
* Struck through repros no longer work on HEAD.