syzbot


KCSAN: data-race in event_sched_out / perf_event_update_userpage (2)

Status: auto-closed as invalid on 2021/05/21 17:09
Subsystems: perf
[Documentation on labels]
First crash: 1382d, last: 1382d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage (3) perf 2 1334d 1345d 0/28 auto-closed as invalid on 2021/07/08 04:06
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage (6) perf 1 1169d 1169d 0/28 auto-closed as invalid on 2021/12/20 08:52
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage (7) perf 2 1120d 1126d 0/28 auto-closed as invalid on 2022/02/08 01:10
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage (5) perf 1 1221d 1221d 0/28 auto-closed as invalid on 2021/10/30 02:46
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage perf 1 1552d 1552d 0/28 auto-closed as invalid on 2020/12/02 23:00
upstream KCSAN: data-race in event_sched_out / perf_event_update_userpage (4) perf 1 1270d 1270d 0/28 auto-closed as invalid on 2021/09/10 05:35

Sample crash report:
==================================================================
BUG: KCSAN: data-race in event_sched_out / perf_event_update_userpage

write to 0xffff88812db198c8 of 8 bytes by task 20975 on cpu 0:
 __perf_update_times kernel/events/core.c:642 [inline]
 perf_event_update_time kernel/events/core.c:650 [inline]
 perf_event_set_state kernel/events/core.c:669 [inline]
 event_sched_out+0x315/0x7f0 kernel/events/core.c:2276
 group_sched_out+0xbf/0x1a0 kernel/events/core.c:2302
 ctx_sched_out+0x36f/0x410 kernel/events/core.c:3253
 task_ctx_sched_out kernel/events/core.c:2671 [inline]
 perf_event_context_sched_out kernel/events/core.c:3458 [inline]
 __perf_event_task_sched_out+0xc28/0xd30 kernel/events/core.c:3561
 perf_event_task_sched_out include/linux/perf_event.h:1227 [inline]
 prepare_task_switch+0x13d/0x140 kernel/sched/core.c:4124
 context_switch kernel/sched/core.c:4274 [inline]
 __schedule+0x374/0x5b0 kernel/sched/core.c:5073
 schedule+0x67/0x90 kernel/sched/core.c:5152
 exit_to_user_mode_loop kernel/entry/common.c:162 [inline]
 exit_to_user_mode_prepare+0xb6/0x170 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:301
 do_syscall_64+0x40/0x50 arch/x86/entry/common.c:56
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff88812db198c8 of 8 bytes by task 20974 on cpu 1:
 __perf_update_times kernel/events/core.c:641 [inline]
 calc_timer_values kernel/events/core.c:5677 [inline]
 perf_event_update_userpage+0x107/0x2f0 kernel/events/core.c:5732
 perf_mmap+0xb6f/0xce0 kernel/events/core.c:6219
 call_mmap include/linux/fs.h:1982 [inline]
 mmap_region+0xbb6/0x13e0 mm/mmap.c:1805
 do_mmap+0x77d/0xc90 mm/mmap.c:1581
 vm_mmap_pgoff+0xfc/0x1d0 mm/util.c:519
 ksys_mmap_pgoff+0x2a8/0x380 mm/mmap.c:1632
 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 20974 Comm: syz-executor.0 Not tainted 5.12.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/04/16 17:06 upstream 7e25f40eab52 7e2b734b .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in event_sched_out / perf_event_update_userpage
* Struck through repros no longer work on HEAD.