syzbot


KCSAN: data-race in ctx_sched_out / perf_mmap

Status: auto-closed as invalid on 2021/12/07 00:36
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 402d, last: 396d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in ctx_sched_out / perf_mmap

write to 0xffff888135dfcdc0 of 8 bytes by task 2864 on cpu 1:
 update_context_time kernel/events/core.c:1533 [inline]
 ctx_sched_out+0x1de/0x450 kernel/events/core.c:3272
 task_ctx_sched_out kernel/events/core.c:2687 [inline]
 perf_event_context_sched_out kernel/events/core.c:3494 [inline]
 __perf_event_task_sched_out+0x679/0xf00 kernel/events/core.c:3597
 perf_event_task_sched_out include/linux/perf_event.h:1231 [inline]
 prepare_task_switch+0x13b/0x140 kernel/sched/core.c:4779
 context_switch kernel/sched/core.c:4921 [inline]
 __schedule+0x397/0x6a0 kernel/sched/core.c:6250
 schedule+0x81/0xb0 kernel/sched/core.c:6323
 freezable_schedule include/linux/freezer.h:172 [inline]
 futex_wait_queue+0xd1/0x170 kernel/futex/waitwake.c:355
 futex_wait+0x126/0x350 kernel/futex/waitwake.c:656
 do_futex+0x28d/0x370 kernel/futex/syscalls.c:122
 __do_sys_futex kernel/futex/syscalls.c:199 [inline]
 __se_sys_futex+0xe8/0x370 kernel/futex/syscalls.c:180
 __x64_sys_futex+0x74/0x80 kernel/futex/syscalls.c:180
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff888135dfcdc0 of 8 bytes by task 2863 on cpu 0:
 perf_set_shadow_time kernel/events/core.c:2512 [inline]
 perf_mmap+0xc23/0xe80 kernel/events/core.c:6352
 call_mmap include/linux/fs.h:2166 [inline]
 mmap_region+0xb00/0x10a0 mm/mmap.c:1787
 do_mmap+0x781/0xc20 mm/mmap.c:1575
 vm_mmap_pgoff+0x117/0x1f0 mm/util.c:519
 ksys_mmap_pgoff+0x284/0x350 mm/mmap.c:1624
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x0000007b1ffa4150 -> 0x0000007b1ffb6956

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

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/11/02 00:31 upstream e66435936756 098b5d53 .config log report info KCSAN: data-race in ctx_sched_out / perf_mmap
ci2-upstream-kcsan-gce 2021/10/26 23:23 upstream 3906fe9bb7f1 d50eb50a .config log report info KCSAN: data-race in ctx_sched_out / perf_mmap
* Struck through repros no longer work on HEAD.