syzbot


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

Status: auto-obsoleted due to no activity on 2024/07/26 11:54
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+2e04e960c3c4d4e6b6ef@syzkaller.appspotmail.com
First crash: 176d, last: 165d
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 513d 521d 0/28 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 315d 315d 0/28 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 0xffff888110a3e630 of 8 bytes by task 12970 on cpu 1:
 __perf_update_times kernel/events/core.c:632 [inline]
 perf_event_update_time+0x15c/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 0xffff888110a3e630 of 8 bytes by task 12971 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

value changed: 0x0000000000007dbf -> 0x000000000001a284

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 12971 Comm: syz-executor.0 Tainted: G        W          6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/21 11:53 upstream 50736169ecc8 dac2aa43 .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
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.