syzbot


KCSAN: data-race in __mem_cgroup_flush_stats / tick_do_update_jiffies64

Status: moderation: reported on 2024/12/03 07:00
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+e3365531ebc9c8a5d7f2@syzkaller.appspotmail.com
First crash: 18d, last: 18d

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

read-write to 0xffffffff866089c0 of 8 bytes by interrupt on cpu 1:
 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
 kcsan_setup_watchpoint+0x404/0x410 kernel/kcsan/core.c:705
 tlb_flush_rmap_batch mm/mmu_gather.c:56 [inline]
 tlb_flush_rmaps+0x259/0x410 mm/mmu_gather.c:89
 zap_pte_range mm/memory.c:1703 [inline]
 zap_pmd_range mm/memory.c:1753 [inline]
 zap_pud_range mm/memory.c:1782 [inline]
 zap_p4d_range mm/memory.c:1803 [inline]
 unmap_page_range+0x1fa6/0x2380 mm/memory.c:1824
 unmap_single_vma+0x142/0x1d0 mm/memory.c:1870
 unmap_vmas+0x18d/0x2b0 mm/memory.c:1914
 exit_mmap+0x18a/0x680 mm/mmap.c:1667
 __mmput+0x28/0x1d0 kernel/fork.c:1353
 mmput+0x4c/0x60 kernel/fork.c:1375
 exit_mm+0xe4/0x190 kernel/exit.c:570
 do_exit+0x55e/0x17f0 kernel/exit.c:925
 do_group_exit+0x142/0x150 kernel/exit.c:1087
 __do_sys_exit_group kernel/exit.c:1098 [inline]
 __se_sys_exit_group kernel/exit.c:1096 [inline]
 __x64_sys_exit_group+0x1f/0x20 kernel/exit.c:1096
 x64_sys_call+0x2db8/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:232
 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 3397 on cpu 0:
 __mem_cgroup_flush_stats+0x8d/0x150 mm/memcontrol.c:612
 flush_memcg_stats_dwork+0x21/0x50 mm/memcontrol.c:650
 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: 0x00000000ffffa269 -> 0x00000000ffffa26a

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3397 Comm: kworker/u8:7 Not tainted 6.13.0-rc1-syzkaller-00002-gcdd30ebb1b9f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events_unbound flush_memcg_stats_dwork
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/03 07:00 upstream cdd30ebb1b9f 578925bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mem_cgroup_flush_stats / tick_do_update_jiffies64
* Struck through repros no longer work on HEAD.