syzbot


KCSAN: data-race in __se_sys_perf_event_open / find_get_context

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+c611b5beb8dec04ff9b2@syzkaller.appspotmail.com
Fix commit: 6c605f837115 perf: Fix data race between pin_count increment/decrement
First crash: 513d, last: 473d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __se_sys_perf_event_open / find_get_context

write to 0xffff888237c2d520 of 4 bytes by task 4144 on cpu 0:
 find_get_context+0x310/0x5c0 kernel/events/core.c:4612
 __do_sys_perf_event_open kernel/events/core.c:12085 [inline]
 __se_sys_perf_event_open+0x85e/0x2740 kernel/events/core.c:11921
 __x64_sys_perf_event_open+0x63/0x70 kernel/events/core.c:11921
 do_syscall_64+0x4a/0x90 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff888237c2d520 of 4 bytes by task 4145 on cpu 1:
 perf_unpin_context kernel/events/core.c:1520 [inline]
 __do_sys_perf_event_open kernel/events/core.c:12316 [inline]
 __se_sys_perf_event_open+0x1be2/0x2740 kernel/events/core.c:11921
 __x64_sys_perf_event_open+0x63/0x70 kernel/events/core.c:11921
 do_syscall_64+0x4a/0x90 arch/x86/entry/common.c:47
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000001 -> 0x00000002

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

Crashes (7):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/06/07 23:07 upstream 614124bea77e b718257f .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/05/24 18:58 upstream c4681547bcce 3c7fef33 .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/05/22 11:41 upstream 45af60e7ced0 3c7fef33 .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/05/20 03:55 upstream c3d0e3fd41b7 a343ba6b .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/05/15 01:33 upstream bd3c9cdb21a2 8bdd5343 .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/05/08 16:28 upstream dd860052c99b bc5434be .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
ci2-upstream-kcsan-gce 2021/04/29 15:42 upstream d72cd4ad4174 77e2b668 .config log report info KCSAN: data-race in __se_sys_perf_event_open / find_get_context
* Struck through repros no longer work on HEAD.