====================================================== WARNING: possible circular locking dependency detected 4.14.197-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/21408 is trying to acquire lock: (&event->child_mutex){+.+.}, at: [] perf_read_group kernel/events/core.c:4541 [inline] (&event->child_mutex){+.+.}, at: [] __perf_read kernel/events/core.c:4623 [inline] (&event->child_mutex){+.+.}, at: [] perf_read+0x2a2/0x7c0 kernel/events/core.c:4638 but task is already holding lock: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1240 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&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:11249 perf_event_init+0x2cc/0x308 kernel/events/core.c:11296 start_kernel+0x46a/0x770 init/main.c:620 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #4 (pmus_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_event_init_cpu+0x2c/0x170 kernel/events/core.c:11243 cpuhp_invoke_callback+0x1e6/0x1a80 kernel/cpu.c:184 cpuhp_up_callbacks kernel/cpu.c:572 [inline] _cpu_up+0x219/0x500 kernel/cpu.c:1140 do_cpu_up+0x9a/0x160 kernel/cpu.c:1175 smp_init+0x197/0x1ac kernel/smp.c:578 kernel_init_freeable+0x3f4/0x619 init/main.c:1068 kernel_init+0xd/0x15b init/main.c:1000 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #3 (cpu_hotplug_lock.rw_sem){++++}: percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] cpus_read_lock+0x39/0xc0 kernel/cpu.c:295 static_key_slow_inc+0xe/0x20 kernel/jump_label.c:123 tracepoint_add_func+0x517/0x750 kernel/tracepoint.c:223 tracepoint_probe_register_prio kernel/tracepoint.c:283 [inline] tracepoint_probe_register+0x8c/0xc0 kernel/tracepoint.c:304 trace_event_reg+0x272/0x330 kernel/trace/trace_events.c:305 perf_trace_event_reg kernel/trace/trace_event_perf.c:122 [inline] perf_trace_event_init kernel/trace/trace_event_perf.c:197 [inline] perf_trace_init+0x424/0xa30 kernel/trace/trace_event_perf.c:221 perf_tp_event_init+0x79/0xf0 kernel/events/core.c:8132 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9368 perf_init_event kernel/events/core.c:9406 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9666 perf_event_alloc kernel/events/core.c:10019 [inline] SYSC_perf_event_open kernel/events/core.c:10123 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10009 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #2 (tracepoints_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 tracepoint_probe_register_prio kernel/tracepoint.c:279 [inline] tracepoint_probe_register+0x68/0xc0 kernel/tracepoint.c:304 trace_event_reg+0x272/0x330 kernel/trace/trace_events.c:305 perf_trace_event_reg kernel/trace/trace_event_perf.c:122 [inline] perf_trace_event_init kernel/trace/trace_event_perf.c:197 [inline] perf_trace_init+0x424/0xa30 kernel/trace/trace_event_perf.c:221 perf_tp_event_init+0x79/0xf0 kernel/events/core.c:8132 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9368 perf_init_event kernel/events/core.c:9406 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9666 perf_event_alloc kernel/events/core.c:10019 [inline] SYSC_perf_event_open kernel/events/core.c:10123 [inline] SyS_perf_event_open+0x67f/0x24b0 kernel/events/core.c:10009 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #1 (event_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_trace_destroy+0x23/0xf0 kernel/trace/trace_event_perf.c:234 _free_event+0x321/0xe20 kernel/events/core.c:4243 free_event+0x32/0x40 kernel/events/core.c:4270 perf_event_release_kernel+0x368/0x8a0 kernel/events/core.c:4414 perf_release+0x33/0x40 kernel/events/core.c:4440 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #0 (&event->child_mutex){+.+.}: 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 perf_read_group kernel/events/core.c:4541 [inline] __perf_read kernel/events/core.c:4623 [inline] perf_read+0x2a2/0x7c0 kernel/events/core.c:4638 __vfs_read+0xe4/0x620 fs/read_write.c:411 vfs_read+0x139/0x340 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xf2/0x210 fs/read_write.c:567 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: &event->child_mutex --> pmus_lock --> &cpuctx_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cpuctx_mutex); lock(pmus_lock); lock(&cpuctx_mutex); lock(&event->child_mutex); *** DEADLOCK *** 1 lock held by syz-executor.5/21408: #0: (&cpuctx_mutex){+.+.}, at: [] perf_event_ctx_lock_nested+0x14d/0x2c0 kernel/events/core.c:1240 stack backtrace: CPU: 0 PID: 21408 Comm: syz-executor.5 Not tainted 4.14.197-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/0x283 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 perf_read_group kernel/events/core.c:4541 [inline] __perf_read kernel/events/core.c:4623 [inline] perf_read+0x2a2/0x7c0 kernel/events/core.c:4638 __vfs_read+0xe4/0x620 fs/read_write.c:411 vfs_read+0x139/0x340 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xf2/0x210 fs/read_write.c:567 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45d5b9 RSP: 002b:00007f4aca323c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000025fc0 RCX: 000000000045d5b9 RDX: 0000000000002020 RSI: 0000000020002e00 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007fff7496587f R14: 00007f4aca3249c0 R15: 000000000118cf4c cannot load conntrack support for proto=2 divide error: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 0 PID: 21531 Comm: syz-executor.5 Not tainted 4.14.197-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff88809f40c400 task.stack: ffff888082f58000 RIP: 0010:fbcon_init+0xccc/0x1dd0 drivers/video/fbdev/core/fbcon.c:1116 RSP: 0018:ffff888082f5f7d8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8880a5b94cc0 RCX: ffffc9000630e000 RDX: 0000000000000000 RSI: ffff8880902d6f74 RDI: ffff8880a5b94e78 RBP: ffff8880902d6bc0 R08: ffff8880a5b94cc0 R09: 0000000000000000 R10: 0000000000000000 R11: ffff88809f40c400 R12: ffff88821928f600 R13: ffff8880902d6ef4 R14: 0000000000000600 R15: 000000000000001d FS: 00007f4aca324700(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4aca302db8 CR3: 00000000a100a000 CR4: 00000000001426f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: visual_init+0x332/0x5e0 drivers/tty/vt/vt.c:746 vc_allocate+0x2c5/0x640 drivers/tty/vt/vt.c:802 con_install+0x4d/0x450 drivers/tty/vt/vt.c:2899 tty_driver_install_tty drivers/tty/tty_io.c:1225 [inline] tty_init_dev.part.0+0x99/0x400 drivers/tty/tty_io.c:1338 tty_init_dev drivers/tty/tty_io.c:1328 [inline] tty_open_by_driver drivers/tty/tty_io.c:1973 [inline] tty_open+0x669/0x8b0 drivers/tty/tty_io.c:2021 chrdev_open+0x23c/0x6d0 fs/char_dev.c:423 do_dentry_open+0x44b/0xec0 fs/open.c:777 vfs_open+0x105/0x220 fs/open.c:888 do_last fs/namei.c:3428 [inline] path_openat+0x628/0x2970 fs/namei.c:3569 do_filp_open+0x179/0x3c0 fs/namei.c:3603 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x417101 RSP: 002b:00007f4aca323820 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 000000000118cf40 RCX: 0000000000417101 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 00007f4aca323850 RBP: 000000000118cf80 R08: 0000000000000000 R09: 000000000000000e R10: 0000000000000064 R11: 0000000000000293 R12: 000000000118cf4c R13: 00007fff7496587f R14: 00007f4aca3249c0 R15: 000000000118cf4c Code: 24 38 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e ad 0d 00 00 8b 44 24 20 31 d2 48 8b 74 24 40 b5 b0 03 00 00 48 89 f2 48 c1 ea 03 89 44 24 20 48 b8 00 00 RIP: fbcon_init+0xccc/0x1dd0 drivers/video/fbdev/core/fbcon.c:1116 RSP: ffff888082f5f7d8 ---[ end trace 752cf0c150675b94 ]---