R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe21b5a6ef R14: 00007f3be2540300 R15: 0000000000022000 Call Trace: ====================================================== WARNING: possible circular locking dependency detected 5.17.0-rc6-next-20220301 #1 Not tainted ------------------------------------------------------ syz-executor.0/9349 is trying to acquire lock: ffffffff851f5b58 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0xe/0x60 but task is already holding lock: ffff888043556020 (&ctx->lock){-.-.}-{2:2}, at: __perf_event_task_sched_in+0x315/0x770 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ctx->lock){-.-.}-{2:2}: _raw_spin_lock+0x2a/0x40 __perf_event_task_sched_out+0x519/0x1950 __schedule+0xead/0x2190 schedule+0xd2/0x1f0 futex_wait_queue+0x144/0x3b0 futex_wait+0x2c9/0x660 do_futex+0x2fb/0x380 __x64_sys_futex+0x1c6/0x4c0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #2 (&rq->__lock){-.-.}-{2:2}: _raw_spin_lock_nested+0x30/0x40 raw_spin_rq_lock_nested+0x1e/0x30 task_fork_fair+0x63/0x4d0 sched_cgroup_fork+0x343/0x490 copy_process+0x4272/0x6d10 kernel_clone+0xe7/0xa60 kernel_thread+0xb5/0xf0 rest_init+0x24/0x3d0 start_kernel+0x489/0x4aa secondary_startup_64_no_verify+0xd5/0xdb -> #1 (&p->pi_lock){-.-.}-{2:2}: _raw_spin_lock_irqsave+0x39/0x50 try_to_wake_up+0xa5/0x1060 up+0x75/0xb0 __up_console_sem+0x6e/0x80 console_unlock+0x603/0xd40 vprintk_emit+0x1b4/0x550 devkmsg_emit.constprop.0+0xbb/0xf0 devkmsg_write.cold+0x83/0xd9 do_iter_readv_writev+0x481/0x760 do_iter_write+0x18d/0x700 vfs_writev+0x1aa/0x630 do_writev+0x139/0x300 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 ((console_sem).lock){-.-.}-{2:2}: __lock_acquire+0x2c2f/0x6120 lock_acquire+0x1a2/0x4d0 _raw_spin_lock_irqsave+0x39/0x50 down_trylock+0xe/0x60 __down_trylock_console_sem+0x3b/0xd0 vprintk_emit+0x162/0x550 vprintk+0x80/0x90 _printk+0xba/0xed show_trace_log_lvl+0x57/0x2bb ex_handler_msr+0x311/0x3a0 fixup_exception+0x307/0xff0 exc_general_protection+0xf6/0x2d0 asm_exc_general_protection+0x1e/0x30 x86_pmu_enable_all+0x2f7/0x3c0 x86_pmu_enable+0x580/0xd90 __perf_event_task_sched_in+0x5e4/0x770 finish_task_switch.isra.0+0x45c/0x870 schedule_tail+0x7/0xd0 ret_from_fork+0x8/0x30 other info that might help us debug this: Chain exists of: (console_sem).lock --> &rq->__lock --> &ctx->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ctx->lock); lock(&rq->__lock); lock(&ctx->lock); lock((console_sem).lock); *** DEADLOCK *** 2 locks held by syz-executor.0/9349: #0: ffff88806ce3f220 (&cpuctx_lock){-.-.}-{2:2}, at: __perf_event_task_sched_in+0x304/0x770 #1: ffff888043556020 (&ctx->lock){-.-.}-{2:2}, at: __perf_event_task_sched_in+0x315/0x770 stack backtrace: CPU: 0 PID: 9349 Comm: syz-executor.0 Not tainted 5.17.0-rc6-next-20220301 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 check_noncircular+0x25f/0x2e0 __lock_acquire+0x2c2f/0x6120 lock_acquire+0x1a2/0x4d0 _raw_spin_lock_irqsave+0x39/0x50 down_trylock+0xe/0x60 __down_trylock_console_sem+0x3b/0xd0 vprintk_emit+0x162/0x550 vprintk+0x80/0x90 _printk+0xba/0xed show_trace_log_lvl+0x57/0x2bb ex_handler_msr+0x311/0x3a0 fixup_exception+0x307/0xff0 exc_general_protection+0xf6/0x2d0 asm_exc_general_protection+0x1e/0x30 RIP: 0010:x86_pmu_enable_all+0x2f7/0x3c0 Code: 00 8b 7c 24 1c 48 8b 44 24 10 0f ae e8 ff d0 89 44 24 10 e8 5b 64 42 00 4c 89 fa 8b 4c 24 08 4c 89 f8 03 4c 24 10 48 c1 ea 20 <0f> 30 66 90 e8 40 64 42 00 e9 cc fd ff ff 48 83 c4 20 5b 5d 41 5c RSP: 0018:ffff8880410f7d08 EFLAGS: 00010016 RAX: 0000000f004000ff RBX: ffff8880081eadc0 RCX: 00000000c0010202 RDX: 000000000000000f RSI: ffffffff8100df45 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff810155ed R11: 0000000000000000 R12: dffffc0000000000 R13: ffff88806ce21c20 R14: ffff88806ce21e20 R15: 0000000f004000ff loop7: detected capacity change from 0 to 98304 x86_pmu_enable+0x580/0xd90 __perf_event_task_sched_in+0x5e4/0x770 finish_task_switch.isra.0+0x45c/0x870 schedule_tail+0x7/0xd0 ret_from_fork+0x8/0x30 ISOFS: Unable to identify CD-ROM format. x86_pmu_enable+0x580/0xd90 __perf_event_task_sched_in+0x5e4/0x770 finish_task_switch.isra.0+0x45c/0x870 schedule_tail+0x7/0xd0 ret_from_fork+0x8/0x30 Call Trace: x86_pmu_enable+0x580/0xd90 __perf_event_task_sched_out+0x764/0x1950 __schedule+0xead/0x2190 preempt_schedule_common+0x45/0xc0 __cond_resched+0x13/0x20 __mutex_lock+0xa3/0x1480 io_sq_thread+0x217/0xfb0 ret_from_fork+0x22/0x30 Call Trace: x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 flush_smp_call_function_queue+0x1df/0x610 __sysvec_call_function_single+0x92/0x3a0 sysvec_call_function_single+0x89/0xc0 asm_sysvec_call_function_single+0x12/0x20 RIP: 0010:kasan_check_range+0x18e/0x1e0 Code: 07 48 39 d0 7d 87 41 bb 01 00 00 00 5b 5d 44 89 d8 41 5c c3 48 85 d2 74 ed 48 01 ea eb 09 48 83 c0 01 48 39 d0 74 df 80 38 00 <74> f2 e9 32 ff ff ff 41 bb 01 00 00 00 44 89 d8 c3 48 29 c3 48 89 RSP: 0018:ffff888047a075f0 EFLAGS: 00000246 RAX: fffff940001c0006 RBX: fffff940001c0007 RCX: ffffffff815b371a RDX: fffff940001c0007 RSI: 0000000000000004 RDI: ffffea0000e00034 RBP: fffff940001c0006 R08: 0000000000000000 R09: ffffea0000e00037 R10: fffff940001c0006 R11: 0000000000000000 R12: dffffc0000000000 R13: 000000000000015c R14: ffffea0000e00000 R15: ffff88801acc0af0 release_pages+0x15a/0x14c0 tlb_flush_mmu+0xe9/0x6b0 unmap_page_range+0x17da/0x2680 unmap_single_vma+0x198/0x310 unmap_vmas+0x16b/0x2f0 exit_mmap+0x192/0x460 mmput+0xc8/0x380 do_exit+0xa05/0x2820 do_group_exit+0xd2/0x2f0 get_signal+0x494/0x26e0 arch_do_signal_or_restart+0x2b0/0x1730 exit_to_user_mode_prepare+0x143/0x1c0 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x48/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fe8414dcb19 Code: Unable to access opcode bytes at RIP 0x7fe8414dcaef. RSP: 002b:00007fe83ea52218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000000 RBX: 00007fe8415eff68 RCX: 00007fe8414dcb19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe8415eff68 RBP: 00007fe8415eff60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe8415eff6c R13: 00007fff99ee304f R14: 00007fe83ea52300 R15: 0000000000022000 I/O error, dev loop7, sector 98176 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.1'. loop6: detected capacity change from 0 to 2232 ISO 9660 Extensions: Microsoft Joliet Level 3 ISOFS: changing to secondary root loop7: detected capacity change from 0 to 131072 loop6: detected capacity change from 0 to 2232 ISO 9660 Extensions: Microsoft Joliet Level 3 ISOFS: changing to secondary root ISOFS: Unable to identify CD-ROM format. loop7: detected capacity change from 0 to 131072 loop6: detected capacity change from 0 to 2232 ISO 9660 Extensions: Microsoft Joliet Level 3 ISOFS: changing to secondary root ISOFS: Unable to identify CD-ROM format. ---------------- Code disassembly (best guess): 0: 00 8b 7c 24 1c 48 add %cl,0x481c247c(%rbx) 6: 8b 44 24 10 mov 0x10(%rsp),%eax a: 0f ae e8 lfence d: ff d0 callq *%rax f: 89 44 24 10 mov %eax,0x10(%rsp) 13: e8 5b 64 42 00 callq 0x426473 18: 4c 89 fa mov %r15,%rdx 1b: 8b 4c 24 08 mov 0x8(%rsp),%ecx 1f: 4c 89 f8 mov %r15,%rax 22: 03 4c 24 10 add 0x10(%rsp),%ecx 26: 48 c1 ea 20 shr $0x20,%rdx * 2a: 0f 30 wrmsr <-- trapping instruction 2c: 66 90 xchg %ax,%ax 2e: e8 40 64 42 00 callq 0x426473 33: e9 cc fd ff ff jmpq 0xfffffe04 38: 48 83 c4 20 add $0x20,%rsp 3c: 5b pop %rbx 3d: 5d pop %rbp 3e: 41 5c pop %r12