syzbot


KCSAN: data-race in detach_pid / perf_event_switch_output (4)

Status: auto-obsoleted due to no activity on 2024/03/23 04:37
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+9ed7c5c8ebb64eed58da@syzkaller.appspotmail.com
First crash: 66d, last: 66d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in detach_pid / perf_event_switch_output perf 16 942d 1093d 0/26 auto-closed as invalid on 2021/10/29 19:05
upstream KCSAN: data-race in detach_pid / perf_event_switch_output (2) perf 1 857d 857d 0/26 auto-closed as invalid on 2022/01/22 22:51
upstream KCSAN: data-race in detach_pid / perf_event_switch_output (3) perf 1 221d 221d 0/26 auto-obsoleted due to no activity on 2023/10/20 14:02

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

write to 0xffff8881429fc6c8 of 8 bytes by task 2025 on cpu 1:
 __change_pid kernel/pid.c:350 [inline]
 detach_pid+0xdb/0x160 kernel/pid.c:361
 __unhash_process kernel/exit.c:130 [inline]
 __exit_signal kernel/exit.c:202 [inline]
 release_task+0x6c3/0xc20 kernel/exit.c:259
 wait_task_zombie kernel/exit.c:1182 [inline]
 wait_consider_task+0x1165/0x1670 kernel/exit.c:1409
 do_wait_thread kernel/exit.c:1472 [inline]
 __do_wait+0xff/0x4f0 kernel/exit.c:1590
 do_wait+0xae/0x270 kernel/exit.c:1624
 kernel_wait4+0x15f/0x1c0 kernel/exit.c:1783
 __do_sys_wait4 kernel/exit.c:1811 [inline]
 __se_sys_wait4 kernel/exit.c:1807 [inline]
 __x64_sys_wait4+0x94/0x120 kernel/exit.c:1807
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff8881429fc6c8 of 8 bytes by task 13285 on cpu 0:
 pid_alive include/linux/pid.h:261 [inline]
 perf_event_pid_type kernel/events/core.c:1334 [inline]
 perf_event_pid kernel/events/core.c:1341 [inline]
 perf_event_switch_output+0x19e/0x390 kernel/events/core.c:9050
 perf_iterate_sb_cpu kernel/events/core.c:7992 [inline]
 perf_iterate_sb+0x353/0x640 kernel/events/core.c:8021
 perf_event_switch kernel/events/core.c:9097 [inline]
 __perf_event_task_sched_in+0x72e/0x790 kernel/events/core.c:4015
 perf_event_task_sched_in include/linux/perf_event.h:1484 [inline]
 finish_task_switch+0x212/0x2a0 kernel/sched/core.c:5269
 context_switch kernel/sched/core.c:5403 [inline]
 __schedule+0x5d8/0x920 kernel/sched/core.c:6727
 __schedule_loop kernel/sched/core.c:6802 [inline]
 schedule+0x54/0x80 kernel/sched/core.c:6817
 worker_thread+0x5fb/0x730 kernel/workqueue.c:2802
 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:242

value changed: 0xffff88813a1b1380 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 13285 Comm: kworker/u4:3 Tainted: G        W          6.8.0-rc4-syzkaller-00267-g0f1dd5e91e2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue:  0x0 (bat_events)
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/17 04:36 upstream 0f1dd5e91e2b 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in detach_pid / perf_event_switch_output
* Struck through repros no longer work on HEAD.