syzbot


KCSAN: data-race in _free_event / perf_pending_task (2)

Status: upstream: reported on 2024/10/14 06:09
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+e75157f5b04f8ff40e17@syzkaller.appspotmail.com
First crash: 45d, last: 12d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [perf?] KCSAN: data-race in _free_event / perf_pending_task (2) 4 (5) 2024/10/14 12:42
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in _free_event / perf_pending_task perf 6 82d 112d 0/28 auto-obsoleted due to no activity on 2024/10/04 07:47

Sample crash report:
==================================================================
BUG: KCSAN: data-race in _free_event / perf_pending_task

write to 0xffff888115ed47d8 of 4 bytes by task 19787 on cpu 0:
 perf_pending_task+0xe8/0x220 kernel/events/core.c:6976
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0xbe/0x130 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888115ed47d8 of 4 bytes by task 19786 on cpu 1:
 perf_pending_task_sync kernel/events/core.c:5302 [inline]
 _free_event+0x3d/0xa10 kernel/events/core.c:5326
 put_event kernel/events/core.c:5454 [inline]
 perf_event_release_kernel+0x61a/0x670 kernel/events/core.c:5579
 perf_release+0x1f/0x30 kernel/events/core.c:5589
 __fput+0x17a/0x6d0 fs/file_table.c:431
 ____fput+0x1c/0x30 fs/file_table.c:459
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0xbe/0x130 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x7ed6c7bf -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 19786 Comm: syz.9.4297 Not tainted 6.12.0-rc6-syzkaller-00169-g906bd684e4b1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/08 12:17 upstream 906bd684e4b1 179b040e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _free_event / perf_pending_task
2024/11/03 03:07 upstream 11066801dd4b f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _free_event / perf_pending_task
2024/10/17 07:47 upstream c964ced77262 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _free_event / perf_pending_task
2024/10/08 15:19 upstream 87d6aab2389e 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _free_event / perf_pending_task
2024/10/06 07:55 upstream fc20a3e57247 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _free_event / perf_pending_task
* Struck through repros no longer work on HEAD.