syzbot


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

Status: auto-obsoleted due to no activity on 2024/11/07 19:03
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+cf8afbaee957fcc0f915@syzkaller.appspotmail.com
First crash: 78d, last: 78d
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 (5) kernel 1 29d 29d 0/28 moderation: reported on 2024/11/22 00:23
upstream KCSAN: data-race in flush_memcg_stats_dwork / tick_do_update_jiffies64 (2) kernel 1 856d 856d 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 963d 963d 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 (3) kernel 1 113d 113d 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 0xffffffff866079c0 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:1691 [inline]
 __hrtimer_run_queues+0x20d/0x5e0 kernel/time/hrtimer.c:1755
 hrtimer_interrupt+0x210/0x7b0 kernel/time/hrtimer.c:1817
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1026 [inline]
 __sysvec_apic_timer_interrupt+0x5c/0x1a0 arch/x86/kernel/apic/apic.c:1043
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
 sysvec_apic_timer_interrupt+0x6e/0x80 arch/x86/kernel/apic/apic.c:1037
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 __preempt_count_dec_and_test arch/x86/include/asm/preempt.h:94 [inline]
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
 _raw_spin_unlock_irqrestore+0x3d/0x60 kernel/locking/spinlock.c:194
 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
 __skb_try_recv_datagram+0x120/0x310 net/core/datagram.c:266
 __unix_dgram_recvmsg+0x25b/0x860 net/unix/af_unix.c:2435
 unix_dgram_recvmsg+0x81/0x90 net/unix/af_unix.c:2537
 sock_recvmsg_nosec+0x107/0x140 net/socket.c:1051
 ____sys_recvmsg+0x271/0x280 net/socket.c:2819
 ___sys_recvmsg net/socket.c:2863 [inline]
 do_recvmmsg+0x2dc/0x740 net/socket.c:2957
 __sys_recvmmsg net/socket.c:3036 [inline]
 __do_sys_recvmmsg net/socket.c:3059 [inline]
 __se_sys_recvmmsg net/socket.c:3052 [inline]
 __x64_sys_recvmmsg+0xe2/0x170 net/socket.c:3052
 x64_sys_call+0x26e3/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:300
 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 0xffffffff866079c0 of 8 bytes by task 85 on cpu 1:
 do_flush_stats mm/memcontrol.c:590 [inline]
 flush_memcg_stats_dwork+0x26/0x90 mm/memcontrol.c:629
 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: 0x00000000ffffb743 -> 0x00000000ffffb744

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 85 Comm: kworker/u8:4 Not tainted 6.12.0-rc1-syzkaller-00046-g7ec462100ef9 #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/10/03 19:02 upstream 7ec462100ef9 d7906eff .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.