R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc08709cf R14: 00007fa2ca12b300 R15: 0000000000022000 Call Trace: ====================================================== WARNING: possible circular locking dependency detected 5.17.0-rc3-next-20220209 #1 Tainted: G W ------------------------------------------------------ syz-executor.2/99427 is trying to acquire lock: ffffffff851f5178 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0xe/0x60 but task is already holding lock: ffff88803b24d020 (&ctx->lock){-...}-{2:2}, at: __perf_install_in_context+0x12d/0x310 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_post_fork+0x343/0x490 copy_process+0x5313/0x6cb0 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+0x53e/0xae0 vprintk_emit+0x198/0x450 vprintk+0x80/0x90 _printk+0xba/0xed dump_stack_print_info.cold+0x1b/0x20 show_regs+0x10/0x40 __warn+0xe2/0x190 report_bug+0x1bd/0x210 handle_bug+0x3c/0x60 exc_invalid_op+0x14/0x40 asm_exc_invalid_op+0x12/0x20 kmem_cache_alloc+0x358/0x490 jbd2_journal_add_journal_head+0x1cb/0x5c0 jbd2_journal_get_write_access+0x112/0x190 __ext4_journal_get_write_access+0x1ba/0x440 ext4_file_open+0x664/0xb80 do_dentry_open+0x4b7/0x1100 path_openat+0x1a3e/0x28a0 do_filp_open+0x1aa/0x400 do_sys_openat2+0x16d/0x4d0 __x64_sys_openat+0x13f/0x1f0 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+0x146/0x450 vprintk+0x80/0x90 _printk+0xba/0xed show_trace_log_lvl+0x57/0x2bb ex_handler_msr+0x311/0x3a0 fixup_exception+0x1c7/0xc90 exc_general_protection+0xed/0x2f0 asm_exc_general_protection+0x1e/0x30 x86_pmu_enable_all+0x2f7/0x3c0 x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 task_function_call+0xe5/0x170 perf_install_in_context+0x2cb/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae 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 *** 4 locks held by syz-executor.2/99427: #0: ffff888008672e60 (&sig->exec_update_lock){++++}-{3:3}, at: __do_sys_perf_event_open+0x1023/0x3040 #1: ffff88803b24d0b0 (&ctx->mutex){+.+.}-{3:3}, at: __do_sys_perf_event_open+0x17cd/0x3040 #2: ffff88806ce3f120 (&cpuctx_lock){-.-.}-{2:2}, at: __perf_install_in_context+0xf4/0x310 #3: ffff88803b24d020 (&ctx->lock){-...}-{2:2}, at: __perf_install_in_context+0x12d/0x310 stack backtrace: CPU: 0 PID: 99427 Comm: syz-executor.2 Tainted: G W 5.17.0-rc3-next-20220209 #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+0x146/0x450 vprintk+0x80/0x90 _printk+0xba/0xed show_trace_log_lvl+0x57/0x2bb ex_handler_msr+0x311/0x3a0 fixup_exception+0x1c7/0xc90 exc_general_protection+0xed/0x2f0 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 cb 5a 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 b0 5a 42 00 e9 cc fd ff ff 48 83 c4 20 5b 5d 41 5c RSP: 0018:ffff88801cadf968 EFLAGS: 00010016 RAX: 0000000f004000ff RBX: ffff888008217260 RCX: 00000000c0010202 RDX: 000000000000000f RSI: ffffffff8100e035 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff8101575d R11: 0000000000000000 R12: dffffc0000000000 R13: ffff88806ce21c20 R14: ffff88806ce21e20 R15: 0000000f004000ff x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 task_function_call+0xe5/0x170 perf_install_in_context+0x2cb/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2447b26b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f244509c188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007f2447c39f60 RCX: 00007f2447b26b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000880 RBP: 00007f2447b80f6d R08: 0000000000000009 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb5bdcbdf R14: 00007f244509c300 R15: 0000000000022000 loop1: detected capacity change from 0 to 512 x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 task_function_call+0xe5/0x170 perf_install_in_context+0x2cb/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2447b26b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f244509c188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007f2447c39f60 RCX: 00007f2447b26b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000880 RBP: 00007f2447b80f6d R08: 0000000000000009 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb5bdcbdf R14: 00007f244509c300 R15: 0000000000022000 EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none. loop1: detected capacity change from 0 to 512 EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none. 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:__sanitizer_cov_trace_pc+0x0/0x60 Code: 48 89 ef 5d e9 c1 09 31 00 be 03 00 00 00 5d e9 d6 7d bc 00 66 0f 1f 44 00 00 48 8b be b0 01 00 00 e8 b4 ff ff ff 31 c0 c3 90 <65> 8b 05 f9 33 bf 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b RSP: 0018:ffff88803bf27700 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88803d2e0000 RDX: 0000000000000000 RSI: ffff88803d2e0000 RDI: 0000000000000003 RBP: ffffea0000d2e540 R08: 0000000000000001 R09: 0000000000000000 R10: ffffffff816ae4b9 R11: 0000000000000000 R12: 0000000000000000 R13: ffff88805532c500 R14: 0000000000000000 R15: dffffc0000000000 page_remove_rmap+0x105/0x490 unmap_page_range+0xd3e/0x2380 unmap_single_vma+0x198/0x310 unmap_vmas+0x16b/0x2f0 exit_mmap+0x192/0x430 mmput+0xc8/0x380 do_exit+0xa05/0x2810 do_group_exit+0xd2/0x2f0 get_signal+0x494/0x26e0 arch_do_signal_or_restart+0x2b0/0x1720 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:0x7fdb515bdb19 Code: Unable to access opcode bytes at RIP 0x7fdb515bdaef. RSP: 002b:00007fdb4eb33218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fdb516d0f68 RCX: 00007fdb515bdb19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fdb516d0f68 RBP: 00007fdb516d0f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdb516d0f6c R13: 00007ffce2f3782f R14: 00007fdb4eb33300 R15: 0000000000022000 Call Trace: x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 task_function_call+0xe5/0x170 perf_install_in_context+0x2cb/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2447b26b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f244509c188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007f2447c39f60 RCX: 00007f2447b26b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000880 RBP: 00007f2447b80f6d R08: 0000000000000009 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeb5bdcbdf R14: 00007f244509c300 R15: 0000000000022000 loop1: detected capacity change from 0 to 512 EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none. Call Trace: loop1: detected capacity change from 0 to 512 x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 perf_install_in_context+0x4a3/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fa2ccbb5b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa2ca12b188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fa2cccc8f60 RCX: 00007fa2ccbb5b19 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000000 RBP: 00007fa2ccc0ff6d R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc08709cf R14: 00007fa2ca12b300 R15: 0000000000022000 EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none. Call Trace: x86_pmu_enable+0x580/0xd90 ctx_resched+0x2b0/0x390 __perf_install_in_context+0x285/0x310 remote_function+0x125/0x1b0 generic_exec_single+0x203/0x300 smp_call_function_single+0x189/0x460 perf_install_in_context+0x4a3/0x550 __do_sys_perf_event_open+0x1bf0/0x3040 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fa2ccbb5b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa2ca12b188 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fa2cccc8f60 RCX: 00007fa2ccbb5b19 RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000000 RBP: 00007fa2ccc0ff6d R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc08709cf R14: 00007fa2ca12b300 R15: 0000000000022000 __nla_validate_parse: 5 callbacks suppressed netlink: 800 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1401 audit(1644404042.602:159): op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:kernel_t:s0 newcontext=system_u:object_r:netutils_exec_t:s0 audit: type=1401 audit(1644404042.704:160): op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:kernel_t:s0 newcontext=system_u:object_r:netutils_exec_t:s0 netlink: 800 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1401 audit(1644404042.801:161): op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:kernel_t:s0 newcontext=system_u:object_r:netutils_exec_t:s0 netlink: 800 bytes leftover after parsing attributes in process `syz-executor.1'. audit: type=1401 audit(1644404042.937:162): op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:kernel_t:s0 newcontext=system_u:object_r:netutils_exec_t:s0 netlink: 800 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 800 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 800 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 800 bytes leftover after parsing attributes in process `syz-executor.0'. SELinux: Context system_u:object_r:hald_mac_exec_t:s0 is not valid (left unmapped). audit: type=1400 audit(1644404043.166:163): avc: denied { associate } for pid=100416 comm="syz-executor.2" name="hpet" dev="devtmpfs" ino=99 scontext=system_u:object_r:unlabeled_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=filesystem permissive=1 srawcon="system_u:object_r:hald_mac_exec_t:s0" loop1: detected capacity change from 0 to 36 loop1: detected capacity change from 0 to 36 loop1: detected capacity change from 0 to 36 ---------------- 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 cb 5a 42 00 callq 0x425ae3 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 b0 5a 42 00 callq 0x425ae3 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