====================================================== WARNING: possible circular locking dependency detected 4.14.295-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/10901 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+0x46/0xbb -> #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:11286 perf_event_init+0x2cc/0x308 kernel/events/core.c:11333 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:11280 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/0x161 init/main.c:1006 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #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:8140 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9374 perf_init_event kernel/events/core.c:9412 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9672 perf_event_alloc kernel/events/core.c:10042 [inline] SYSC_perf_event_open kernel/events/core.c:10146 [inline] SyS_perf_event_open+0x683/0x2530 kernel/events/core.c:10032 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #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:8140 perf_try_init_event+0x15b/0x1f0 kernel/events/core.c:9374 perf_init_event kernel/events/core.c:9412 [inline] perf_event_alloc.part.0+0xe2d/0x2640 kernel/events/core.c:9672 perf_event_alloc kernel/events/core.c:10042 [inline] SYSC_perf_event_open kernel/events/core.c:10146 [inline] SyS_perf_event_open+0x683/0x2530 kernel/events/core.c:10032 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #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+0x46/0xbb 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/10901: #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: 10901 Comm: syz-executor.1 Not tainted 4.14.295-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 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+0x46/0xbb RIP: 0033:0x7fec7ea9c5a9 RSP: 002b:00007fec7d410118 EFLAGS: 00000246 ORIG_RAX: 000000000000003c RAX: ffffffffffffffda RBX: 00007fec7ebbdf80 RCX: 00007fec7ea9c5a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fec7eaf7580 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffc77918ef R14: 00007fec7d410300 R15: 0000000000022000 UDF-fs: error (device loop0): udf_process_sequence: Block 99 of volume descriptor sequence is corrupted or we could not read it audit: type=1800 audit(1664649823.143:3): pid=11048 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14072 res=0 UDF-fs: error (device loop0): udf_process_sequence: Block 1984 of volume descriptor sequence is corrupted or we could not read it UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop0): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: error (device loop0): udf_read_tagged: read failed, block=512, location=512 UDF-fs: warning (device loop0): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: warning (device loop0): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed audit: type=1800 audit(1664649823.343:4): pid=11079 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="file0" dev="sda1" ino=14076 res=0 loop3: [POWERTEC] p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 loop3: p1 start 287891887 is beyond EOD, truncated Dev loop1: unable to read RDB block 1 loop1: unable to read partition table loop1: partition table beyond EOD, truncated loop3: p2 start 4102415637 is beyond EOD, truncated loop_reread_partitions: partition scan of loop1 () failed (rc=-5) loop3: p3 start 3459336586 is beyond EOD, truncated loop3: p4 start 1279807879 is beyond EOD, truncated loop3: p5 start 1991230656 is beyond EOD, truncated loop3: p6 start 423102389 is beyond EOD, truncated loop3: p7 start 3820775209 is beyond EOD, truncated loop3: p8 start 2679842549 is beyond EOD, truncated loop3: p9 start 1425395842 is beyond EOD, truncated loop3: p10 start 1421683607 is beyond EOD, truncated loop3: p11 start 626768712 is beyond EOD, truncated loop3: p12 start 4221531391 is beyond EOD, truncated EXT4-fs warning (device sda1): ext4_ioctl:716: Setting inode version is not supported with metadata_csum enabled. unregister_netdevice: waiting for ip6gre0 to become free. Usage count = -1 tmpfs: Bad mount option fd Dev loop4: unable to read RDB block 1 loop4: unable to read partition table Dev loop1: unable to read RDB block 8 loop1: AHDI p2 loop1: partition table partially beyond EOD, truncated loop4: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop4 () failed (rc=-5) autofs4:pid:11271:check_dev_ioctl_version: ioctl control interface version mismatch: kernel(1.1), user(1.10), cmd(0xc0189375) autofs4:pid:11271:validate_dev_ioctl: invalid device control module version supplied for cmd(0xc0189375) Dev loop1: unable to read RDB block 8 loop1: AHDI p2 loop1: partition table partially beyond EOD, truncated audit: type=1804 audit(1664649824.943:5): pid=11274 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir3015182885/syzkaller.csAvXv/101/file0" dev="sda1" ino=14101 res=1 Dev loop1: unable to read RDB block 8 loop1: AHDI p2 loop1: partition table partially beyond EOD, truncated PM: Marking nosave pages: [mem 0x00000000-0x00000fff] PM: Marking nosave pages: [mem 0x0009f000-0x000fffff] PM: Marking nosave pages: [mem 0xbfffd000-0xffffffff] Dev loop3: unable to read RDB block 7 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) PM: Basic memory bitmaps created PM: Basic memory bitmaps freed audit: type=1800 audit(1664649825.243:6): pid=11364 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=14123 res=0 print_req_error: I/O error, dev loop3, sector 0 Dev loop1: unable to read RDB block 8 Buffer I/O error on dev loop3, logical block 0, async page read loop1: AHDI p2 ldm_validate_partition_table(): Disk read failed. Dev loop3: unable to read RDB block 0 loop1: partition table partially beyond EOD, truncated PM: Marking nosave pages: [mem 0x00000000-0x00000fff] PM: Marking nosave pages: [mem 0x0009f000-0x000fffff] loop3: unable to read partition table loop3: partition table beyond EOD, truncated PM: Marking nosave pages: [mem 0xbfffd000-0xffffffff] PM: Basic memory bitmaps created PM: Basic memory bitmaps freed Dev loop5: unable to read RDB block 1 loop5: unable to read partition table loop5: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop5 () failed (rc=-5) Dev loop5: unable to read RDB block 1 loop5: unable to read partition table loop5: partition table beyond EOD, truncated Dev loop2: unable to read RDB block 1 Dev loop3: unable to read RDB block 7 loop2: unable to read partition table loop3: unable to read partition table Dev loop0: unable to read RDB block 1 loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) loop0: unable to read partition table loop0: partition table beyond EOD, truncated loop2: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop0 () failed (rc=-5) loop_reread_partitions: partition scan of loop2 () failed (rc=-5) Dev loop0: unable to read RDB block 1 loop0: unable to read partition table loop0: partition table beyond EOD, truncated Dev loop3: unable to read RDB block 7 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) Dev loop2: unable to read RDB block 4 loop2: unable to read partition table Dev loop3: unable to read RDB block 7 loop3: unable to read partition table loop2: partition table beyond EOD, truncated loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop2 () failed (rc=-5) loop_reread_partitions: partition scan of loop3 () failed (rc=-5) audit: type=1800 audit(1664649827.323:7): pid=11556 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name="file0" dev="sda1" ino=14160 res=0 Dev loop3: unable to read RDB block 7 loop3: unable to read partition table audit: type=1800 audit(1664649827.363:8): pid=11551 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=14150 res=0 loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) audit: type=1800 audit(1664649827.463:9): pid=11584 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=13876 res=0 audit: type=1800 audit(1664649827.543:10): pid=11606 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="file0" dev="sda1" ino=14161 res=0 audit: type=1800 audit(1664649827.633:11): pid=11621 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="file0" dev="sda1" ino=14149 res=0 hid-generic 0000:0000:0000.0001: item fetching failed at offset 0/1 hid-generic: probe of 0000:0000:0000.0001 failed with error -22 loop3: [POWERTEC] p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 loop3: p1 start 1201669868 is beyond EOD, truncated loop3: p2 start 1649959649 is beyond EOD, truncated PM: Marking nosave pages: [mem 0x00000000-0x00000fff] loop3: p3 start 2445856330 is beyond EOD, truncated PM: Marking nosave pages: [mem 0x0009f000-0x000fffff] loop3: p4 start 354105194 is beyond EOD, PM: Marking nosave pages: [mem 0xbfffd000-0xffffffff] PM: Basic memory bitmaps created truncated loop3: p5 start 3022055924 is beyond EOD, truncated loop3: p6 start 423102389 is beyond EOD, truncated PM: Basic memory bitmaps freed loop3: p7 start 3820775209 is beyond EOD, truncated loop3: p8 start 2679842549 is beyond EOD, truncated loop3: p9 start 1425395842 is beyond EOD, truncated loop3: p10 start 1421683607 is beyond EOD, truncated loop3: p11 start 626768712 is beyond EOD, truncated loop3: p12 start 4221531391 is beyond EOD, truncated misc userio: Invalid payload size loop3: [POWERTEC]