syzbot


KCSAN: data-race in __perf_event_read_value / perf_event_set_state (5)

Status: moderation: reported on 2025/08/28 17:07
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+636eed5293f727855034@syzkaller.appspotmail.com
First crash: 2d13h, last: 2d13h
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __perf_event_read_value / perf_event_set_state perf 6 1 456d 456d 0/29 auto-obsoleted due to no activity on 2024/07/06 04:07
upstream KCSAN: data-race in __perf_event_read_value / perf_event_set_state (2) perf 6 1 315d 315d 0/29 auto-obsoleted due to no activity on 2024/11/23 12:41
upstream KCSAN: data-race in __perf_event_read_value / perf_event_set_state (3) perf 6 4 197d 247d 0/29 auto-obsoleted due to no activity on 2025/04/11 22:12
upstream KCSAN: data-race in __perf_event_read_value / perf_event_set_state (4) perf 6 1 101d 101d 0/29 auto-obsoleted due to no activity on 2025/07/17 00:50

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

write to 0xffff88811a486400 of 8 bytes by task 9207 on cpu 0:
 __perf_update_times kernel/events/core.c:-1 [inline]
 perf_event_update_time kernel/events/core.c:734 [inline]
 perf_event_set_state+0x195/0x440 kernel/events/core.c:753
 event_sched_out+0x2d4/0x4d0 kernel/events/core.c:2393
 group_sched_out kernel/events/core.c:2417 [inline]
 __pmu_ctx_sched_out+0x3e7/0x530 kernel/events/core.c:3460
 ctx_sched_out+0x273/0x2d0 kernel/events/core.c:3541
 task_ctx_sched_out+0x4d/0x70 kernel/events/core.c:2861
 perf_event_context_sched_out kernel/events/core.c:3748 [inline]
 __perf_event_task_sched_out+0x286/0x370 kernel/events/core.c:3848
 perf_event_task_sched_out include/linux/perf_event.h:1654 [inline]
 prepare_task_switch kernel/sched/core.c:5155 [inline]
 context_switch kernel/sched/core.c:5304 [inline]
 __schedule+0xaf8/0xb30 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x5f/0xd0 kernel/sched/core.c:7058
 futex_do_wait kernel/futex/waitwake.c:358 [inline]
 __futex_wait+0x117/0x260 kernel/futex/waitwake.c:687
 futex_wait+0x9d/0x1d0 kernel/futex/waitwake.c:715
 do_futex+0x2bf/0x380 kernel/futex/syscalls.c:102
 __do_sys_futex kernel/futex/syscalls.c:179 [inline]
 __se_sys_futex+0x2ed/0x360 kernel/futex/syscalls.c:160
 __x64_sys_futex+0x78/0x90 kernel/futex/syscalls.c:160
 x64_sys_call+0x2e39/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:203
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811a486400 of 8 bytes by task 9220 on cpu 1:
 __perf_event_read_value+0x82/0x1d0 kernel/events/core.c:5893
 perf_read_one kernel/events/core.c:6050 [inline]
 __perf_read kernel/events/core.c:6103 [inline]
 perf_read+0x173/0x4d0 kernel/events/core.c:6120
 loop_rw_iter+0x2c6/0x3f0 include/linux/uio.h:-1
 io_iter_do_read io_uring/rw.c:830 [inline]
 __io_read+0xbcb/0xc20 io_uring/rw.c:941
 io_read+0x1c/0x60 io_uring/rw.c:1020
 __io_issue_sqe+0xfe/0x2e0 io_uring/io_uring.c:1773
 io_issue_sqe+0x53/0x970 io_uring/io_uring.c:1796
 io_wq_submit_work+0x3f7/0x5f0 io_uring/io_uring.c:1908
 io_worker_handle_work+0x44e/0x9b0 io_uring/io-wq.c:650
 io_wq_worker+0x22e/0x870 io_uring/io-wq.c:704
 ret_from_fork+0xda/0x150 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

value changed: 0x0000000006293c98 -> 0x0000000006294ed0

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 9220 Comm: iou-wrk-9207 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/28 17:06 upstream 07d9df80082b e12e5ba4 .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.