====================================================== WARNING: possible circular locking dependency detected 4.14.134+ #18 Not tainted ------------------------------------------------------ syz-executor.0/26674 is trying to acquire lock: (&cpuctx_mutex/1){+.+.}, at: [<000000000af119c0>] mutex_lock_double kernel/events/core.c:9909 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000000af119c0>] __perf_event_ctx_lock_double kernel/events/core.c:9968 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000000af119c0>] SYSC_perf_event_open kernel/events/core.c:10233 [inline] (&cpuctx_mutex/1){+.+.}, at: [<000000000af119c0>] SyS_perf_event_open+0x12cf/0x2560 kernel/events/core.c:9988 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] mutex_lock_double kernel/events/core.c:9908 [inline] (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] __perf_event_ctx_lock_double kernel/events/core.c:9968 [inline] (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] SYSC_perf_event_open kernel/events/core.c:10233 [inline] (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] SyS_perf_event_open+0x12c2/0x2560 kernel/events/core.c:9988 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&cpuctx_mutex){+.+.}: -> #1 (pmus_lock){+.+.}: -> #0 (&cpuctx_mutex/1){+.+.}: other info that might help us debug this: Chain exists of: &cpuctx_mutex/1 --> pmus_lock --> &cpuctx_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex); lock(pmus_lock); lock(&cpuctx_mutex); lock(&cpuctx_mutex/1); *** DEADLOCK *** 1 lock held by syz-executor.0/26674: #0: (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] mutex_lock_double kernel/events/core.c:9908 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] __perf_event_ctx_lock_double kernel/events/core.c:9968 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] SYSC_perf_event_open kernel/events/core.c:10233 [inline] #0: (&cpuctx_mutex){+.+.}, at: [<0000000057a24101>] SyS_perf_event_open+0x12c2/0x2560 kernel/events/core.c:9988 stack backtrace: CPU: 0 PID: 26674 Comm: syz-executor.0 Not tainted 4.14.134+ #18 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xca/0x134 lib/dump_stack.c:53 print_circular_bug.isra.0.cold+0x2dc/0x425 kernel/locking/lockdep.c:1258