syzbot


KCSAN: data-race in wq_worker_tick / wq_worker_tick

Status: moderation: reported on 2023/12/07 10:03
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+1f9c6a9361cf67ffc0d9@syzkaller.appspotmail.com
First crash: 248d, last: 2d05h

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

read-write to 0xffff8881000670a8 of 8 bytes by interrupt on cpu 0:
 wq_worker_tick+0x66/0x3c0 kernel/workqueue.c:1339
 scheduler_tick+0x13e/0x1d0 kernel/sched/core.c:5690
 update_process_times+0xf5/0x110 kernel/time/timer.c:2092
 tick_sched_handle kernel/time/tick-sched.c:255 [inline]
 tick_nohz_highres_handler+0x244/0x2c0 kernel/time/tick-sched.c:1519
 __run_hrtimer kernel/time/hrtimer.c:1689 [inline]
 __hrtimer_run_queues+0x210/0x5d0 kernel/time/hrtimer.c:1753
 hrtimer_interrupt+0x20d/0x7b0 kernel/time/hrtimer.c:1815
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline]
 __sysvec_apic_timer_interrupt+0x52/0x190 arch/x86/kernel/apic/apic.c:1082
 sysvec_apic_timer_interrupt+0x6a/0x80 arch/x86/kernel/apic/apic.c:1076
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
 get_current arch/x86/include/asm/current.h:42 [inline]
 get_ctx kernel/kcsan/core.c:206 [inline]
 check_access kernel/kcsan/core.c:750 [inline]
 __tsan_read4+0xdb/0x180 kernel/kcsan/core.c:1024
 lookahead_bufs drivers/tty/tty_buffer.c:398 [inline]
 flush_to_ldisc+0x22c/0x400 drivers/tty/tty_buffer.c:497
 process_one_work kernel/workqueue.c:2633 [inline]
 process_scheduled_works+0x5b8/0xa40 kernel/workqueue.c:2706
 worker_thread+0x525/0x730 kernel/workqueue.c:2787
 kthread+0x1d7/0x210 kernel/kthread.c:388
 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243

read-write to 0xffff8881000670a8 of 8 bytes by interrupt on cpu 1:
 wq_worker_tick+0x66/0x3c0 kernel/workqueue.c:1339
 scheduler_tick+0x13e/0x1d0 kernel/sched/core.c:5690
 update_process_times+0xf5/0x110 kernel/time/timer.c:2092
 tick_sched_handle kernel/time/tick-sched.c:255 [inline]
 tick_nohz_highres_handler+0x244/0x2c0 kernel/time/tick-sched.c:1519
 __run_hrtimer kernel/time/hrtimer.c:1689 [inline]
 __hrtimer_run_queues+0x210/0x5d0 kernel/time/hrtimer.c:1753
 hrtimer_interrupt+0x20d/0x7b0 kernel/time/hrtimer.c:1815
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline]
 __sysvec_apic_timer_interrupt+0x52/0x190 arch/x86/kernel/apic/apic.c:1082
 sysvec_apic_timer_interrupt+0x6a/0x80 arch/x86/kernel/apic/apic.c:1076
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
 is_atomic kernel/kcsan/core.c:249 [inline]
 should_watch kernel/kcsan/core.c:277 [inline]
 check_access kernel/kcsan/core.c:752 [inline]
 __tsan_unaligned_write8+0x129/0x180 kernel/kcsan/core.c:1025
 native_save_fl arch/x86/include/asm/irqflags.h:19 [inline]
 arch_local_save_flags arch/x86/include/asm/irqflags.h:67 [inline]
 arch_local_irq_save arch/x86/include/asm/irqflags.h:103 [inline]
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
 _raw_spin_lock_irqsave+0x28/0xa0 kernel/locking/spinlock.c:162
 tty_insert_flip_string_and_push_buffer+0x33/0x200 drivers/tty/tty_buffer.c:557
 pty_write+0x7e/0xa0 drivers/tty/pty.c:118
 tty_put_char+0x83/0xb0 drivers/tty/tty_io.c:3168
 n_tty_process_echo_ops drivers/tty/n_tty.c:664 [inline]
 __process_echoes+0x3a3/0x6a0 drivers/tty/n_tty.c:709
 flush_echoes drivers/tty/n_tty.c:807 [inline]
 __receive_buf drivers/tty/n_tty.c:1632 [inline]
 n_tty_receive_buf_common+0x8e6/0xbc0 drivers/tty/n_tty.c:1729
 n_tty_receive_buf2+0x33/0x40 drivers/tty/n_tty.c:1775
 tty_ldisc_receive_buf+0x60/0xe0 drivers/tty/tty_buffer.c:386
 tty_port_default_receive_buf+0x59/0x90 drivers/tty/tty_port.c:37
 receive_buf drivers/tty/tty_buffer.c:444 [inline]
 flush_to_ldisc+0x1ca/0x400 drivers/tty/tty_buffer.c:494
 process_one_work kernel/workqueue.c:2633 [inline]
 process_scheduled_works+0x5b8/0xa40 kernel/workqueue.c:2706
 worker_thread+0x525/0x730 kernel/workqueue.c:2787
 kthread+0x1d7/0x210 kernel/kthread.c:388
 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243

value changed: 0x0000000004a1e9c0 -> 0x0000000004a210d0

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 2800 Comm: kworker/u4:82 Not tainted 6.8.0-rc6-syzkaller-00120-g87adedeba51a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue: events_unbound flush_to_ldisc
==================================================================

Crashes (102):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/01 12:12 upstream 87adedeba51a 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/27 22:53 upstream 45ec2f5f6ed3 d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/24 13:00 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/23 09:03 upstream ffd2cb6b718e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/23 06:34 upstream 1c892cdd8fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/20 13:18 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/13 16:01 upstream c664e16bb1ba e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/08 06:40 upstream 547ab8fc4cb0 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/06 02:31 upstream 54be6c6c5ae8 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/04 17:25 upstream 54be6c6c5ae8 a67b2c42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/02/01 05:49 upstream 6764c317b6bb 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/29 12:27 upstream 41bccc98fb79 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/23 09:55 upstream 5d9248eed480 1c0ecc51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/21 22:12 upstream 4fbbed787267 9bd8dcda .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/18 17:45 upstream 296455ade1fd 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/18 00:14 upstream 1b1934dbbdcf 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2024/01/13 20:06 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/25 13:43 upstream 861deac3b092 fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/18 11:57 upstream ceb6a6f023fd 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/15 04:12 upstream c7402612e2e6 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/11 09:16 upstream a39b6ac3781d 28b24332 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/08 20:33 upstream 5e3f5b81de80 28b24332 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/12/01 12:41 upstream e8f60209d6cf f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/11/28 23:33 upstream 18d46e76d7c2 1adfb6f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/11/26 07:14 upstream 090472ed9c92 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/10/30 05:05 upstream ffc253263a13 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/10/08 08:37 upstream b9ddbb0cde2a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/10/08 07:28 upstream 59f3fd30af35 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/30 14:49 upstream 9f3ebbef746f 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/10 15:09 upstream 535a265d7f0d 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/08 08:17 upstream 4a0fc73da97e 72324844 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/03 13:04 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/02 20:17 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/09/02 04:25 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/31 03:01 upstream ef2a0b7cdbc5 84803932 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/29 11:59 upstream 1c59d383390f 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/28 01:12 upstream 2dde18cd1d8f 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/27 20:28 upstream 28f20a19294d 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/26 08:52 upstream 382d4cd18475 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/25 23:29 upstream 382d4cd18475 03d9c195 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/25 13:05 upstream 4f9e7fabf864 03d9c195 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/25 07:03 upstream 4f9e7fabf864 49be837e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/23 22:30 upstream a5e505a99ca7 b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/23 11:31 upstream 89bf6209cad6 b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
2023/08/23 05:51 upstream 53663f4103ff b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wq_worker_tick / wq_worker_tick
* Struck through repros no longer work on HEAD.