====================================================== WARNING: possible circular locking dependency detected 4.14.262-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/19239 is trying to acquire lock: (pmus_lock){+.+.}, at: [] swevent_hlist_get kernel/events/core.c:7925 [inline] (pmus_lock){+.+.}, at: [] perf_swevent_init+0x11e/0x4b0 kernel/events/core.c:7985 but task is already holding lock: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1241 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&cpuctx_mutex/1){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 mutex_lock_double kernel/events/core.c:9933 [inline] __perf_event_ctx_lock_double kernel/events/core.c:9992 [inline] SYSC_perf_event_open kernel/events/core.c:10254 [inline] SyS_perf_event_open+0xd28/0x24b0 kernel/events/core.c:10012 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #1 (&cpuctx_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_event_init_cpu+0xb7/0x170 kernel/events/core.c:11252 perf_event_init+0x2cc/0x308 kernel/events/core.c:11299 start_kernel+0x46a/0x770 init/main.c:620 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (pmus_lock){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 swevent_hlist_get kernel/events/core.c:7925 [inline] perf_swevent_init+0x11e/0x4b0 kernel/events/core.c:7985 perf_try_init_event+0xdf/0x1f0 kernel/events/core.c:9371 perf_init_event kernel/events/core.c:9409 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9669 perf_event_alloc kernel/events/core.c:10022 [inline] SYSC_perf_event_open kernel/events/core.c:10126 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10012 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Chain exists of: pmus_lock --> &cpuctx_mutex --> &cpuctx_mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex/1); lock(&cpuctx_mutex); lock(&cpuctx_mutex/1); lock(pmus_lock); *** DEADLOCK *** 2 locks held by syz-executor.0/19239: #0: (&pmus_srcu){....}, at: [] fdput include/linux/file.h:40 [inline] #0: (&pmus_srcu){....}, at: [] perf_cgroup_connect kernel/events/core.c:849 [inline] #0: (&pmus_srcu){....}, at: [] perf_event_alloc.part.0+0xc44/0x2640 kernel/events/core.c:9664 #1: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1241 stack backtrace: CPU: 0 PID: 19239 Comm: syz-executor.0 Not tainted 4.14.262-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 swevent_hlist_get kernel/events/core.c:7925 [inline] perf_swevent_init+0x11e/0x4b0 kernel/events/core.c:7985 perf_try_init_event+0xdf/0x1f0 kernel/events/core.c:9371 perf_init_event kernel/events/core.c:9409 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9669 perf_event_alloc kernel/events/core.c:10022 [inline] SYSC_perf_event_open kernel/events/core.c:10126 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10012 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f1dbcc6cfe9 RSP: 002b:00007f1dbb5e2168 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007f1dbcd7ff60 RCX: 00007f1dbcc6cfe9 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 00000000200000c0 RBP: 00007f1dbccc708d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffdc93a13f R14: 00007f1dbb5e2300 R15: 0000000000022000 PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex bridge: RTM_NEWNEIGH with invalid state 0x0 bridge: RTM_NEWNEIGH with invalid state 0x0 bridge: RTM_NEWNEIGH with invalid state 0x0 PF_BRIDGE: RTM_NEWNEIGH with invalid address PF_BRIDGE: RTM_NEWNEIGH with invalid address PF_BRIDGE: RTM_NEWNEIGH with invalid address PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex