syzbot


WARNING in perf_event_release_kernel

Status: fixed on 2024/09/12 10:52
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+732a0a87685f80d378b4@syzkaller.appspotmail.com
Fix commit: 9ad46f1fef42 perf: Fix event leak upon exec and file release
First crash: 291d, last: 62d
Fix bisection: fixed by (bisect log) :
commit 9ad46f1fef421d43cdab3a7d1744b2f43b54dae0
Author: Frederic Weisbecker <frederic@kernel.org>
Date: Fri Jun 21 09:16:01 2024 +0000

  perf: Fix event leak upon exec and file release

  
Bug presence (1)
Date Name Commit Repro Result
2023/12/25 upstream (ToT) 861deac3b092 C [report] WARNING in perf_event_release_kernel
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 WARNING in perf_event_release_kernel origin:upstream C error 1 164d 291d 0/3 upstream: reported C repro on 2023/12/25 13:49
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/09/11 18:53 5h35m bisect fix linux-5.15.y OK (1) job log
2024/08/10 10:27 1h50m bisect fix linux-5.15.y OK (0) job log log
2024/07/07 07:07 44m bisect fix linux-5.15.y OK (0) job log log
2024/05/31 13:24 55m bisect fix linux-5.15.y OK (0) job log log
2024/05/01 06:40 1h54m bisect fix linux-5.15.y OK (0) job log log
2024/03/31 19:36 1h19m bisect fix linux-5.15.y OK (0) job log log
2024/03/01 10:20 42m bisect fix linux-5.15.y OK (0) job log log
2024/01/25 12:20 2h00m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
------------[ cut here ]------------
unexpected event refcount: 2; ptr=ffff88801def8bd0
WARNING: CPU: 0 PID: 3506 at kernel/events/core.c:5167 free_event kernel/events/core.c:5165 [inline]
WARNING: CPU: 0 PID: 3506 at kernel/events/core.c:5167 perf_event_release_kernel+0x794/0x870 kernel/events/core.c:5332
Modules linked in:
CPU: 0 PID: 3506 Comm: syz-executor147 Not tainted 5.15.145-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:free_event kernel/events/core.c:5165 [inline]
RIP: 0010:perf_event_release_kernel+0x794/0x870 kernel/events/core.c:5332
Code: 00 fc ff df 80 3c 08 00 48 8b 5c 24 20 74 08 4c 89 e7 e8 af 4d 29 00 49 8b 34 24 48 c7 c7 40 b8 92 8a 4c 89 fa e8 8c 4d ab ff <0f> 0b eb 82 e8 13 98 df ff eb 05 e8 0c 98 df ff 4c 8b 7c 24 18 49
RSP: 0018:ffffc90002b37860 EFLAGS: 00010246
RAX: 33d9f1618d540e00 RBX: ffffc90002b378e0 RCX: ffff88807ac40000
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90002b37958 R08: ffffffff81665aec R09: ffffed10173467a8
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff88801def8df8
R13: 1ffff11003bdf1d4 R14: dead000000000100 R15: ffff88801def8bd0
FS:  0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555556736ca8 CR3: 0000000022a16000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 perf_release+0x37/0x40 kernel/events/core.c:5353
 __fput+0x3bf/0x890 fs/file_table.c:280
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x6a3/0x2480 kernel/exit.c:872
 do_group_exit+0x144/0x310 kernel/exit.c:994
 get_signal+0xc66/0x14e0 kernel/signal.c:2889
 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:172
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
 ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:291
RIP: 0033:0x7f0f3d864bf9
Code: Unable to access opcode bytes at RIP 0x7f0f3d864bcf.
RSP: 002b:00007ffd8cb9c148 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f0f3d864bf9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000200
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/25 13:47 linux-5.15.y d93fa2c78854 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf WARNING in perf_event_release_kernel
* Struck through repros no longer work on HEAD.