syzbot


KCSAN: data-race in __cgroup_account_cputime_field / cgroup_rstat_flush_locked

Status: auto-closed as invalid on 2022/03/09 08:01
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 300d, last: 300d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __cgroup_account_cputime_field / cgroup_rstat_flush_locked

write to 0xffffe8ffffd74d40 of 8 bytes by interrupt on cpu 1:
 __cgroup_account_cputime_field+0xb1/0x100
 cgroup_account_cputime_field include/linux/cgroup.h:812 [inline]
 task_group_account_field kernel/sched/cputime.c:110 [inline]
 account_system_index_time+0x7c/0x90 kernel/sched/cputime.c:173
 update_process_times+0x5c/0x160 kernel/time/timer.c:1783
 tick_sched_handle kernel/time/tick-sched.c:226 [inline]
 tick_sched_timer+0x19d/0x220 kernel/time/tick-sched.c:1428
 __run_hrtimer+0x163/0x460 kernel/time/hrtimer.c:1685
 __hrtimer_run_queues kernel/time/hrtimer.c:1749 [inline]
 hrtimer_interrupt+0x37e/0xac0 kernel/time/hrtimer.c:1811
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline]
 __sysvec_apic_timer_interrupt+0xa3/0x240 arch/x86/kernel/apic/apic.c:1103
 sysvec_apic_timer_interrupt+0x88/0xb0 arch/x86/kernel/apic/apic.c:1097
 asm_sysvec_apic_timer_interrupt+0x12/0x20
 console_unlock+0x938/0xb60 kernel/printk/printk.c:2716
 vprintk_emit+0xe7/0x3c0 kernel/printk/printk.c:2245
 dev_vprintk_emit+0x1c9/0x1ed drivers/base/core.c:4604
 dev_printk_emit+0x7e/0xa2 drivers/base/core.c:4615
 __dev_printk+0xfa/0x103 drivers/base/core.c:4627
 _dev_info+0x8b/0xad drivers/base/core.c:4673
 attach_store+0x6ba/0x870 drivers/usb/usbip/vhci_sysfs.c:438
 dev_attr_store+0x40/0x60 drivers/base/core.c:2110
 sysfs_kf_write+0xa6/0xc0 fs/sysfs/file.c:136
 kernfs_fop_write_iter+0x1d3/0x2d0 fs/kernfs/file.c:296
 call_write_iter include/linux/fs.h:2074 [inline]
 new_sync_write fs/read_write.c:503 [inline]
 vfs_write+0x7f5/0x950 fs/read_write.c:590
 ksys_write+0xd9/0x190 fs/read_write.c:643
 __do_sys_write fs/read_write.c:655 [inline]
 __se_sys_write fs/read_write.c:652 [inline]
 __x64_sys_write+0x3e/0x50 fs/read_write.c:652
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffffe8ffffd74d40 of 8 bytes by task 1823 on cpu 0:
 cgroup_base_stat_flush kernel/cgroup/rstat.c:328 [inline]
 cgroup_rstat_flush_locked+0x2ce/0x7e0 kernel/cgroup/rstat.c:161
 cgroup_rstat_flush_irqsafe+0x24/0x40 kernel/cgroup/rstat.c:215
 __mem_cgroup_flush_stats mm/memcontrol.c:652 [inline]
 flush_memcg_stats_dwork+0x6c/0xf0 mm/memcontrol.c:665
 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307
 worker_thread+0x616/0xa70 kernel/workqueue.c:2454
 kthread+0x1bf/0x1e0 kernel/kthread.c:377
 ret_from_fork+0x1f/0x30

value changed: 0x0000000a0a87ac9d -> 0x0000000a0b20431d

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 1823 Comm: kworker/u4:3 Not tainted 5.17.0-rc2-syzkaller-00039-g9f7fb8de5d9b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_unbound flush_memcg_stats_dwork
==================================================================
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/02/02 07:52 upstream 9f7fb8de5d9b 4ebb2798 .config log report info KCSAN: data-race in __cgroup_account_cputime_field / cgroup_rstat_flush_locked
* Struck through repros no longer work on HEAD.