syzbot


KCSAN: data-race in __perf_event_read_value / perf_event_set_state

Status: moderation: reported on 2024/06/01 04:07
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+aba480c23f3ffe49f4a1@syzkaller.appspotmail.com
First crash: 14d, last: 14d

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

write to 0xffff888111a42e80 of 8 bytes by task 10046 on cpu 0:
 perf_event_update_time kernel/events/core.c:641 [inline]
 perf_event_set_state+0x1a1/0x3f0 kernel/events/core.c:660
 event_sched_out+0x444/0x630 kernel/events/core.c:2301
 group_sched_out kernel/events/core.c:2325 [inline]
 __pmu_ctx_sched_out+0x3a0/0x4d0 kernel/events/core.c:3271
 ctx_sched_out+0x294/0x2f0 kernel/events/core.c:3340
 task_ctx_sched_out kernel/events/core.c:2672 [inline]
 perf_event_context_sched_out kernel/events/core.c:3580 [inline]
 __perf_event_task_sched_out+0x40f/0xfe0 kernel/events/core.c:3679
 perf_event_task_sched_out include/linux/perf_event.h:1496 [inline]
 prepare_task_switch kernel/sched/core.c:5212 [inline]
 context_switch kernel/sched/core.c:5355 [inline]
 __schedule+0x939/0x940 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x55/0xc0 kernel/sched/core.c:6837
 futex_wait_queue kernel/futex/waitwake.c:370 [inline]
 __futex_wait+0x141/0x290 kernel/futex/waitwake.c:669
 futex_wait+0x99/0x1c0 kernel/futex/waitwake.c:697
 do_futex+0x276/0x370 kernel/futex/syscalls.c:102
 __do_sys_futex kernel/futex/syscalls.c:179 [inline]
 __se_sys_futex+0x25d/0x3a0 kernel/futex/syscalls.c:160
 __x64_sys_futex+0x78/0x90 kernel/futex/syscalls.c:160
 x64_sys_call+0x28c1/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:203
 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 0xffff888111a42e80 of 8 bytes by task 10058 on cpu 1:
 __perf_event_read_value+0xba/0x1c0 kernel/events/core.c:5480
 perf_read_one kernel/events/core.c:5635 [inline]
 __perf_read kernel/events/core.c:5688 [inline]
 perf_read+0x17a/0x4a0 kernel/events/core.c:5705
 loop_rw_iter+0x23d/0x360
 io_iter_do_read io_uring/rw.c:764 [inline]
 __io_read+0x930/0x9b0 io_uring/rw.c:857
 io_read+0x1e/0x60 io_uring/rw.c:927
 io_issue_sqe+0x150/0xc80 io_uring/io_uring.c:1751
 io_wq_submit_work+0x42b/0x5a0 io_uring/io_uring.c:1860
 io_worker_handle_work+0x45a/0x9a0 io_uring/io-wq.c:597
 io_wq_worker+0x286/0x820 io_uring/io-wq.c:651
 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: 0x00000000061d6fe1 -> 0x00000000061d857b

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 10058 Comm: iou-wrk-10046 Not tainted 6.10.0-rc1-syzkaller-00104-gd8ec19857b09 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/01 04:06 upstream d8ec19857b09 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __perf_event_read_value / perf_event_set_state
* Struck through repros no longer work on HEAD.