syzbot


KCSAN: data-race in perf_event_set_state / perf_event_update_time (3)

Status: moderation: reported on 2024/06/10 18:16
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+2e04e960c3c4d4e6b6ef@syzkaller.appspotmail.com
First crash: 4d10h, last: 4d10h
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in perf_event_set_state / perf_event_update_time perf 2 341d 349d 0/27 auto-obsoleted due to no activity on 2023/08/13 16:32
upstream KCSAN: data-race in perf_event_set_state / perf_event_update_time (2) perf 1 143d 143d 0/27 auto-obsoleted due to no activity on 2024/02/27 20:45

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

read to 0xffff888118892200 of 8 bytes by task 13291 on cpu 1:
 __perf_update_times kernel/events/core.c:628 [inline]
 perf_event_update_time+0x126/0x1b0 kernel/events/core.c:641
 perf_mmap+0xbe8/0xd50 kernel/events/core.c:6650
 call_mmap include/linux/fs.h:2107 [inline]
 mmap_region+0xa5b/0x1620 mm/mmap.c:2886
 do_mmap+0x6f9/0xb10 mm/mmap.c:1397
 vm_mmap_pgoff+0x133/0x290 mm/util.c:573
 ksys_mmap_pgoff+0x292/0x340 mm/mmap.c:1443
 x64_sys_call+0x1835/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:10
 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

write to 0xffff888118892200 of 8 bytes by task 13292 on cpu 0:
 perf_event_update_time kernel/events/core.c:641 [inline]
 perf_event_set_state+0x175/0x3f0 kernel/events/core.c:660
 event_sched_in+0xe9/0x6d0 kernel/events/core.c:2538
 group_sched_in kernel/events/core.c:2587 [inline]
 merge_sched_in kernel/events/core.c:3846 [inline]
 visit_groups_merge+0xbe2/0x1c00 kernel/events/core.c:3791
 pmu_groups_sched_in kernel/events/core.c:3873 [inline]
 ctx_groups_sched_in+0xa0/0x100 kernel/events/core.c:3886
 ctx_sched_in+0x217/0x230 kernel/events/core.c:3940
 perf_event_sched_in kernel/events/core.c:2683 [inline]
 perf_event_context_sched_in kernel/events/core.c:3986 [inline]
 __perf_event_task_sched_in+0x4b5/0x7f0 kernel/events/core.c:4015
 perf_event_task_sched_in include/linux/perf_event.h:1473 [inline]
 finish_task_switch+0x218/0x2b0 kernel/sched/core.c:5277
 context_switch kernel/sched/core.c:5411 [inline]
 __schedule+0x5e8/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

value changed: 0x0000000000000000 -> 0x00000000000038b6

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 13292 Comm: syz-executor.3 Not tainted 6.10.0-rc3-syzkaller #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/10 18:16 upstream 83a7eefedc9b 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in perf_event_set_state / perf_event_update_time
* Struck through repros no longer work on HEAD.