Warning: Permanently added '10.128.1.67' (ECDSA) to the list of known hosts. executing program [ 33.171255] [ 33.172896] ====================================================== [ 33.179193] WARNING: possible circular locking dependency detected [ 33.185593] 4.14.290-syzkaller #0 Not tainted [ 33.190067] ------------------------------------------------------ [ 33.196369] syz-executor139/7962 is trying to acquire lock: [ 33.202057] (event_mutex){+.+.}, at: [] ftrace_profile_set_filter+0x64/0x1c0 [ 33.210888] [ 33.210888] but task is already holding lock: [ 33.216834] (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 [ 33.230691] [ 33.230691] which lock already depends on the new lock. [ 33.230691] [ 33.239698] [ 33.239698] the existing dependency chain (in reverse order) is: [ 33.247483] [ 33.247483] -> #4 (&cpuctx_mutex){+.+.}: [ 33.253132] __mutex_lock+0xc4/0x1310 [ 33.257952] perf_event_init_cpu+0xb7/0x170 [ 33.262775] perf_event_init+0x2cc/0x308 [ 33.267347] start_kernel+0x45d/0x763 [ 33.271743] secondary_startup_64+0xa5/0xb0 [ 33.276655] [ 33.276655] -> #3 (pmus_lock){+.+.}: [ 33.281857] __mutex_lock+0xc4/0x1310 [ 33.286170] perf_event_init_cpu+0x2c/0x170 [ 33.290992] cpuhp_invoke_callback+0x1e6/0x1a80 [ 33.296157] _cpu_up+0x21e/0x520 [ 33.300017] do_cpu_up+0x9a/0x160 [ 33.303981] smp_init+0x197/0x1ac [ 33.307931] kernel_init_freeable+0x406/0x626 [ 33.312948] kernel_init+0xd/0x15e [ 33.317004] ret_from_fork+0x24/0x30 [ 33.321210] [ 33.321210] -> #2 (cpu_hotplug_lock.rw_sem){++++}: [ 33.327615] cpus_read_lock+0x39/0xc0 [ 33.331916] static_key_slow_inc+0xe/0x20 [ 33.336561] tracepoint_add_func+0x747/0xa40 [ 33.341479] tracepoint_probe_register+0x8c/0xc0 [ 33.346754] trace_event_reg+0x272/0x330 [ 33.351313] perf_trace_init+0x424/0xa30 [ 33.355907] perf_tp_event_init+0x79/0xf0 [ 33.360583] perf_try_init_event+0x15b/0x1f0 [ 33.365487] perf_event_alloc.part.0+0xe2d/0x2640 [ 33.370841] SyS_perf_event_open+0x683/0x2530 [ 33.375852] do_syscall_64+0x1d5/0x640 [ 33.380271] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 33.386008] [ 33.386008] -> #1 (tracepoints_mutex){+.+.}: [ 33.391890] __mutex_lock+0xc4/0x1310 [ 33.396201] tracepoint_probe_register+0x68/0xc0 [ 33.401467] trace_event_reg+0x272/0x330 [ 33.406050] perf_trace_init+0x424/0xa30 [ 33.410616] perf_tp_event_init+0x79/0xf0 [ 33.415278] perf_try_init_event+0x15b/0x1f0 [ 33.420196] perf_event_alloc.part.0+0xe2d/0x2640 [ 33.425551] SyS_perf_event_open+0x683/0x2530 [ 33.430569] do_syscall_64+0x1d5/0x640 [ 33.434968] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 33.440762] [ 33.440762] -> #0 (event_mutex){+.+.}: [ 33.446169] lock_acquire+0x170/0x3f0 [ 33.450478] __mutex_lock+0xc4/0x1310 [ 33.454802] ftrace_profile_set_filter+0x64/0x1c0 [ 33.460322] _perf_ioctl+0x12b3/0x1a60 [ 33.464720] perf_ioctl+0x55/0x80 [ 33.468668] do_vfs_ioctl+0x75a/0xff0 [ 33.472977] SyS_ioctl+0x7f/0xb0 [ 33.476840] do_syscall_64+0x1d5/0x640 [ 33.481223] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 33.486903] [ 33.486903] other info that might help us debug this: [ 33.486903] [ 33.495388] Chain exists of: [ 33.495388] event_mutex --> pmus_lock --> &cpuctx_mutex [ 33.495388] [ 33.505526] Possible unsafe locking scenario: [ 33.505526] [ 33.511554] CPU0 CPU1 [ 33.516201] ---- ---- [ 33.520848] lock(&cpuctx_mutex); [ 33.524358] lock(pmus_lock); [ 33.530051] lock(&cpuctx_mutex); [ 33.536098] lock(event_mutex); [ 33.539527] [ 33.539527] *** DEADLOCK *** [ 33.539527] [ 33.545558] 1 lock held by syz-executor139/7962: [ 33.550284] #0: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 [ 33.559988] [ 33.559988] stack backtrace: [ 33.564460] CPU: 1 PID: 7962 Comm: syz-executor139 Not tainted 4.14.290-syzkaller #0 [ 33.572363] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 [ 33.581690] Call Trace: [ 33.584254] dump_stack+0x1b2/0x281 [ 33.587869] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 33.593815] __lock_acquire+0x2e0e/0x3f20 [ 33.597937] ? trace_hardirqs_on+0x10/0x10 [ 33.602144] ? save_trace+0xd6/0x290 [ 33.605843] lock_acquire+0x170/0x3f0 [ 33.609619] ? ftrace_profile_set_filter+0x64/0x1c0 [ 33.614607] ? ftrace_profile_set_filter+0x64/0x1c0 [ 33.619614] __mutex_lock+0xc4/0x1310 [ 33.623412] ? ftrace_profile_set_filter+0x64/0x1c0 [ 33.628412] ? ftrace_profile_set_filter+0x64/0x1c0 [ 33.633400] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 33.638825] ? __might_fault+0x104/0x1b0 [ 33.642862] ? lock_acquire+0x170/0x3f0 [ 33.646805] ? lock_downgrade+0x740/0x740 [ 33.650925] ftrace_profile_set_filter+0x64/0x1c0 [ 33.655740] ? ftrace_profile_free_filter+0x60/0x60 [ 33.660726] ? memdup_user+0x54/0xa0 [ 33.664413] _perf_ioctl+0x12b3/0x1a60 [ 33.668275] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 33.673699] ? lock_downgrade+0x740/0x740 [ 33.677818] ? perf_event_set_output+0x510/0x510 [ 33.682544] ? lock_acquire+0x170/0x3f0 [ 33.686502] ? lock_downgrade+0x740/0x740 [ 33.690623] ? perf_event_ctx_lock_nested+0x247/0x2c0 [ 33.695792] ? _perf_ioctl+0x1a60/0x1a60 [ 33.699828] perf_ioctl+0x55/0x80 [ 33.703255] do_vfs_ioctl+0x75a/0xff0 [ 33.707028] ? ioctl_preallocate+0x1a0/0x1a0 [ 33.711410] ? perf_bp_event+0x170/0x170 [ 33.715445] ? lock_downgrade+0x740/0x740 [ 33.719566] ? security_file_ioctl+0x83/0xb0 [ 33.723958] SyS_ioctl+0x7f/0xb0 [ 33.727295] ? do_vfs_ioctl+0xff0/0xff0 [ 33.731242] do_syscall_64+0x1d5/0x640 [ 33.735116] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 33.740297] RIP: 0033:0x7f38030ac0e9 [ 33.743984] RSP: 002b:00007ffeef341868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.751665] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f38030ac0e9 [ 33.758929] RDX: 00000000200000c0 RSI: 0000000040082406 RDI: 0000000000000003 [ 33.766186] RBP: 00007f38030700d0 R08: 0000000000000000 R09: 0000000000000000 [ 3