====================================================== WARNING: possible circular locking dependency detected 4.14.138 #34 Not tainted ------------------------------------------------------ syz-executor.0/14526 is trying to acquire lock: (pmus_lock){+.+.}, at: [] swevent_hlist_get kernel/events/core.c:7891 [inline] (pmus_lock){+.+.}, at: [] perf_swevent_init+0x12e/0x4c0 kernel/events/core.c:7951 but task is already holding lock: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x150/0x2c0 kernel/events/core.c:1235 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&cpuctx_mutex/1){+.+.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 mutex_lock_double kernel/events/core.c:9904 [inline] __perf_event_ctx_lock_double kernel/events/core.c:9963 [inline] SYSC_perf_event_open+0x134c/0x2610 kernel/events/core.c:10225 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&cpuctx_mutex){+.+.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 perf_event_init_cpu+0xc2/0x170 kernel/events/core.c:11223 perf_event_init+0x2d8/0x31a kernel/events/core.c:11270 start_kernel+0x3b6/0x6fd init/main.c:621 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:381 x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:362 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (pmus_lock){+.+.}: check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 swevent_hlist_get kernel/events/core.c:7891 [inline] perf_swevent_init+0x12e/0x4c0 kernel/events/core.c:7951 perf_try_init_event+0xe6/0x200 kernel/events/core.c:9342 perf_init_event kernel/events/core.c:9380 [inline] perf_event_alloc.part.0+0xd90/0x25b0 kernel/events/core.c:9640 perf_event_alloc kernel/events/core.c:9993 [inline] SYSC_perf_event_open+0xad1/0x2610 kernel/events/core.c:10097 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 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/14526: #0: (&pmus_srcu){....}, at: [] perf_event_alloc.part.0+0xbaa/0x25b0 kernel/events/core.c:9636 #1: (&cpuctx_mutex/1){+.+.}, at: [] perf_event_ctx_lock_nested+0x150/0x2c0 kernel/events/core.c:1235 stack backtrace: CPU: 1 PID: 14526 Comm: syz-executor.0 Not tainted 4.14.138 #34 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+0x138/0x19c lib/dump_stack.c:53 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3991 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 swevent_hlist_get kernel/events/core.c:7891 [inline] perf_swevent_init+0x12e/0x4c0 kernel/events/core.c:7951 perf_try_init_event+0xe6/0x200 kernel/events/core.c:9342 perf_init_event kernel/events/core.c:9380 [inline] perf_event_alloc.part.0+0xd90/0x25b0 kernel/events/core.c:9640 perf_event_alloc kernel/events/core.c:9993 [inline] SYSC_perf_event_open+0xad1/0x2610 kernel/events/core.c:10097 SyS_perf_event_open+0x34/0x40 kernel/events/core.c:9983 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459829 RSP: 002b:00007fa62178fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459829 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000180 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000006 R11: 0000000000000246 R12: 00007fa6217906d4 R13: 00000000004c6684 R14: 00000000004db6b8 R15: 00000000ffffffff kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (ffff8880a4b6d3a0): kobject_uevent_env kobject: 'loop5' (ffff8880a4b6d3a0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (ffff8880a4b6d3a0): kobject_uevent_env kobject: 'loop5' (ffff8880a4b6d3a0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop5' (ffff8880a4b6d3a0): kobject_uevent_env kobject: 'loop5' (ffff8880a4b6d3a0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4b1caa0): kobject_uevent_env kobject: 'loop4' (ffff8880a4b1caa0): fill_kobj_path: path = '/devices/virtual/block/loop4'