====================================================== WARNING: possible circular locking dependency detected 4.14.303-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/13413 is trying to acquire lock: (event_mutex){+.+.}, at: [] perf_trace_destroy+0x23/0xf0 kernel/trace/trace_event_perf.c:234 but task is already holding lock: (&event->child_mutex){+.+.}, at: [] perf_event_release_kernel+0x208/0x8a0 kernel/events/core.c:4405 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&event->child_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 perf_event_for_each_child+0x82/0x140 kernel/events/core.c:4690 perf_event_for_each kernel/events/core.c:4707 [inline] _perf_ioctl+0x3db/0x1a60 kernel/events/core.c:4875 perf_ioctl+0x55/0x80 kernel/events/core.c:4889 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #4 (&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:11293 perf_event_init+0x2cc/0x308 kernel/events/core.c:11340 start_kernel+0x45d/0x763 init/main.c:624 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #3 (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:11287 cpuhp_invoke_callback+0x1e6/0x1a80 kernel/cpu.c:186 cpuhp_up_callbacks kernel/cpu.c:574 [inline] _cpu_up+0x21e/0x520 kernel/cpu.c:1193 do_cpu_up+0x9a/0x160 kernel/cpu.c:1229 smp_init+0x197/0x1ac kernel/smp.c:578 kernel_init_freeable+0x406/0x626 init/main.c:1074 kernel_init+0xd/0x15c init/main.c:1006 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406 -> #2 (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:297 static_key_slow_inc+0xe/0x20 kernel/jump_label.c:123 tracepoint_add_func+0x747/0xa40 kernel/tracepoint.c:269 tracepoint_probe_register_prio kernel/tracepoint.c:331 [inline] tracepoint_probe_register+0x8c/0xc0 kernel/tracepoint.c:352 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:8145 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9381 perf_init_event kernel/events/core.c:9419 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9679 perf_event_alloc kernel/events/core.c:10049 [inline] SYSC_perf_event_open kernel/events/core.c:10153 [inline] SyS_perf_event_open+0x683/0x2530 kernel/events/core.c:10039 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #1 (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:327 [inline] tracepoint_probe_register+0x68/0xc0 kernel/tracepoint.c:352 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:8145 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9381 perf_init_event kernel/events/core.c:9419 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9679 perf_event_alloc kernel/events/core.c:10049 [inline] SYSC_perf_event_open kernel/events/core.c:10153 [inline] SyS_perf_event_open+0x683/0x2530 kernel/events/core.c:10039 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #0 (event_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_trace_destroy+0x23/0xf0 kernel/trace/trace_event_perf.c:234 _free_event+0x321/0xe20 kernel/events/core.c:4246 free_event+0x32/0x40 kernel/events/core.c:4273 perf_event_release_kernel+0x368/0x8a0 kernel/events/core.c:4417 perf_release+0x33/0x40 kernel/events/core.c:4443 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868 SYSC_exit kernel/exit.c:934 [inline] SyS_exit+0x1e/0x20 kernel/exit.c:932 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 other info that might help us debug this: Chain exists of: event_mutex --> &cpuctx_mutex --> &event->child_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&event->child_mutex); lock(&cpuctx_mutex); lock(&event->child_mutex); lock(event_mutex); *** DEADLOCK *** 2 locks held by syz-executor.1/13413: #0: (&ctx->mutex){+.+.}, at: [] perf_event_release_kernel+0x1fe/0x8a0 kernel/events/core.c:4404 #1: (&event->child_mutex){+.+.}, at: [] perf_event_release_kernel+0x208/0x8a0 kernel/events/core.c:4405 stack backtrace: CPU: 0 PID: 13413 Comm: syz-executor.1 Not tainted 4.14.303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 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 perf_trace_destroy+0x23/0xf0 kernel/trace/trace_event_perf.c:234 _free_event+0x321/0xe20 kernel/events/core.c:4246 free_event+0x32/0x40 kernel/events/core.c:4273 perf_event_release_kernel+0x368/0x8a0 kernel/events/core.c:4417 perf_release+0x33/0x40 kernel/events/core.c:4443 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868 SYSC_exit kernel/exit.c:934 [inline] SyS_exit+0x1e/0x20 kernel/exit.c:932 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7f7e6ebce0c9 RSP: 002b:00007f7e6d140118 EFLAGS: 00000246 ORIG_RAX: 000000000000003c RAX: ffffffffffffffda RBX: 00007f7e6ecedf80 RCX: 00007f7e6ebce0c9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f7e6ec29ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff06d3f0cf R14: 00007f7e6d140300 R15: 0000000000022000 vhci_hcd vhci_hcd.0: pdev(4) rhport(0) sockfd(3) vhci_hcd vhci_hcd.0: devid(0) speed(4) speed_str(wireless) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device vhci_hcd vhci_hcd.0: pdev(4) rhport(0) sockfd(3) vhci_hcd vhci_hcd.0: devid(0) speed(4) speed_str(wireless) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device vhci_hcd vhci_hcd.0: pdev(2) rhport(0) sockfd(4) vhci_hcd vhci_hcd.0: devid(0) speed(2) speed_str(full-speed) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device ax25_connect(): syz-executor.4 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.4 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.4 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.4 uses autobind, please contact jreuter@yaina.de overlayfs: unrecognized mount option "smackfsfloor=" or missing value netlink: 588 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 232 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 103252 bytes leftover after parsing attributes in process `syz-executor.0'. tc_ctl_action: received NO action attribs syz-executor.3 uses old SIOCAX25GETINFO vivid-002: ================= START STATUS ================= vivid-002: Test Pattern: 75% Colorbar vivid-002: Fill Percentage of Frame: 100 vivid-002: Horizontal Movement: No Movement vivid-002: Vertical Movement: No Movement vivid-002: OSD Text Mode: All vivid-002: Show Border: false vivid-002: Show Square: false vivid-002: Sensor Flipped Horizontally: false vivid-002: Sensor Flipped Vertically: false vivid-002: Insert SAV Code in Image: false vivid-002: Insert EAV Code in Image: false vivid-002: Reduced Framerate: false vivid-002: Enable Capture Cropping: true vivid-002: Enable Capture Composing: true vivid-002: Enable Capture Scaler: true vivid-002: Timestamp Source: End of Frame vivid-002: Colorspace: sRGB vivid-002: Transfer Function: Default vivid-002: Y'CbCr Encoding: Default vivid-002: HSV Encoding: Hue 0-179 vivid-002: Quantization: Default vivid-002: Apply Alpha To Red Only: false vivid-002: Standard Aspect Ratio: 4x3 vivid-002: DV Timings Signal Mode: Current DV Timings vivid-002: DV Timings: 640x480p59 inactive vivid-002: DV Timings Aspect Ratio: Source Width x Height vivid-002: Maximum EDID Blocks: 2 vivid-002: Limited RGB Range (16-235): false vivid-002: Rx RGB Quantization Range: Automatic tpg source WxH: 640x360 (Y'CbCr) tpg field: 1 tpg crop: 640x360@0x0 tpg compose: 640x360@0x0 tpg colorspace: 8 tpg transfer function: 0/0 tpg Y'CbCr encoding: 0/0 tpg HSV encoding: 128/0 tpg quantization: 0/0 tpg RGB range: 0/2 vivid-002: ================== END STATUS ================== IPVS: set_ctl: invalid protocol: 0 172.20.20.187:0 IPVS: set_ctl: invalid protocol: 0 172.20.20.187:0 netlink: 232 bytes leftover after parsing attributes in process `syz-executor.5'. IPVS: set_ctl: invalid protocol: 0 172.20.20.187:0 IPVS: set_ctl: invalid protocol: 0 172.20.20.187:0 IPVS: set_ctl: invalid protocol: 0 224.0.0.2:0 netlink: 96232 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 1664 bytes leftover after parsing attributes in process `syz-executor.4'. IPVS: set_ctl: invalid protocol: 59 172.20.20.41:0 IPVS: set_ctl: invalid protocol: 0 172.20.20.170:0 Cannot find add_set index 0 as target Bluetooth: hci5 command 0x0405 tx timeout bridge0: port 2(bridge_slave_1) entered disabled state bridge0: port 1(bridge_slave_0) entered disabled state device bridge0 entered promiscuous mode device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state IPVS: ftp: loaded support on port[0] = 21 device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state ntfs: volume version 3.1. sctp: [Deprecated]: syz-executor.4 (pid 14674) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead IPVS: set_ctl: invalid protocol: 0 0.0.0.0:0 netlink: 32 bytes leftover after parsing attributes in process `syz-executor.5'. bridge0: port 2(bridge_slave_1) entered disabled state bridge0: port 1(bridge_slave_0) entered disabled state device bridge0 entered promiscuous mode device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state