------------[ cut here ]------------ ====================================================== WARNING: possible circular locking dependency detected 6.1.84-syzkaller #0 Not tainted ------------------------------------------------------ udevd/13436 is trying to acquire lock: ffffffff8d006b38 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:139 but task is already holding lock: ffff8880b993aa18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rq->__lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1354 [inline] rq_lock kernel/sched/sched.h:1644 [inline] task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11869 sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4686 copy_process+0x2442/0x4060 kernel/fork.c:2384 kernel_clone+0x222/0x920 kernel/fork.c:2682 user_mode_thread+0x12e/0x190 kernel/fork.c:2758 rest_init+0x23/0x300 init/main.c:697 start_kernel+0x0/0x53f init/main.c:892 start_kernel+0x496/0x53f init/main.c:1139 secondary_startup_64_no_verify+0xcf/0xdb -> #1 (&p->pi_lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 try_to_wake_up+0xad/0x12e0 kernel/sched/core.c:4112 up+0x6e/0x90 kernel/locking/semaphore.c:191 __up_console_sem+0x11a/0x1e0 kernel/printk/printk.c:260 __console_unlock kernel/printk/printk.c:2697 [inline] console_unlock+0x591/0x7c0 kernel/printk/printk.c:2908 vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303 dev_vprintk_emit+0x2aa/0x323 drivers/base/core.c:4902 dev_printk_emit+0xd9/0x118 drivers/base/core.c:4913 _dev_warn+0x11e/0x165 drivers/base/core.c:4969 firmware_fallback_sysfs+0x674/0x940 drivers/base/firmware_loader/fallback.c:229 _request_firmware+0xc13/0x1200 drivers/base/firmware_loader/main.c:856 request_firmware_work_func+0x126/0x270 drivers/base/firmware_loader/main.c:1105 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307 -> #0 ((console_sem).lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:139 __down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:243 console_trylock kernel/printk/printk.c:2650 [inline] console_trylock_spinning kernel/printk/printk.c:1896 [inline] vprintk_emit+0x1ee/0x740 kernel/printk/printk.c:2302 _printk+0xd1/0x111 kernel/printk/printk.c:2328 __report_bug lib/bug.c:195 [inline] report_bug+0x342/0x500 lib/bug.c:219 handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:324 exc_invalid_op+0x16/0x40 arch/x86/kernel/traps.c:345 asm_exc_invalid_op+0x16/0x20 arch/x86/include/asm/idtentry.h:568 __local_bh_enable_ip+0x1b3/0x1f0 __sock_map_delete net/core/sock_map.c:426 [inline] sock_map_delete_elem+0xcb/0x130 net/core/sock_map.c:448 bpf_prog_8c0e092b1e199972+0x5b/0x5f bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 __traceiter_sched_switch+0x91/0xc0 include/trace/events/sched.h:222 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2116/0x4550 kernel/sched/core.c:6555 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870 irqentry_exit+0x53/0x80 kernel/entry/common.c:439 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 check_kcov_mode kernel/kcov.c:175 [inline] write_comp_data kernel/kcov.c:236 [inline] __sanitizer_cov_trace_const_cmp1+0x30/0x80 kernel/kcov.c:290 tomoyo_encode2 security/tomoyo/realpath.c:36 [inline] tomoyo_encode+0x14b/0x530 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x594/0x5d0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x350/0xb80 security/tomoyo/file.c:922 tomoyo_path_rename+0x194/0x1e0 security/tomoyo/tomoyo.c:287 security_path_rename+0x16f/0x210 security/security.c:1217 do_renameat2+0x991/0x1440 fs/namei.c:5016 __do_sys_rename fs/namei.c:5075 [inline] __se_sys_rename fs/namei.c:5073 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5073 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: (console_sem).lock --> &p->pi_lock --> &rq->__lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rq->__lock); lock(&p->pi_lock); lock(&rq->__lock); lock((console_sem).lock); *** DEADLOCK *** 5 locks held by udevd/13436: #0: ffff88807e1c4460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff88807df12870 (&type->i_mutex_dir_key#5/1){+.+.}-{3:3}, at: do_renameat2+0x65a/0x1440 fs/namei.c:4968 #2: ffffffff8d7184a8 (tomoyo_ss){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d7184a8 (tomoyo_ss){....}-{0:0}, at: srcu_read_lock include/linux/srcu.h:165 [inline] #2: ffffffff8d7184a8 (tomoyo_ss){....}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1110 [inline] #2: ffffffff8d7184a8 (tomoyo_ss){....}-{0:0}, at: tomoyo_path2_perm+0x321/0xb80 security/tomoyo/file.c:921 #3: ffff8880b993aa18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 #4: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #4: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #4: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314 stack backtrace: CPU: 1 PID: 13436 Comm: udevd Not tainted 6.1.84-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:139 __down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:243 console_trylock kernel/printk/printk.c:2650 [inline] console_trylock_spinning kernel/printk/printk.c:1896 [inline] vprintk_emit+0x1ee/0x740 kernel/printk/printk.c:2302 _printk+0xd1/0x111 kernel/printk/printk.c:2328 __report_bug lib/bug.c:195 [inline] report_bug+0x342/0x500 lib/bug.c:219 handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:324 exc_invalid_op+0x16/0x40 arch/x86/kernel/traps.c:345 asm_exc_invalid_op+0x16/0x20 arch/x86/include/asm/idtentry.h:568 RIP: 0010:__local_bh_enable_ip+0x1b3/0x1f0 kernel/softirq.c:376 Code: 04 25 28 00 00 00 48 3b 44 24 60 75 4a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 d0 fe ff ff e8 3f 00 00 00 eb a2 <0f> 0b e9 02 ff ff ff 48 c7 c1 e4 9e 73 8e 80 e1 07 80 c1 03 38 c1 RSP: 0018:ffffc90003ccf240 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 1ffff92000799e4c RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897f1fb RBP: ffffc90003ccf2f8 R08: dffffc0000000000 R09: ffffed100f075146 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff888023c62480 R14: ffffc90003ccf280 R15: 0000000000000201 __sock_map_delete net/core/sock_map.c:426 [inline] sock_map_delete_elem+0xcb/0x130 net/core/sock_map.c:448 bpf_prog_8c0e092b1e199972+0x5b/0x5f bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 __traceiter_sched_switch+0x91/0xc0 include/trace/events/sched.h:222 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2116/0x4550 kernel/sched/core.c:6555 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870 irqentry_exit+0x53/0x80 kernel/entry/common.c:439 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline] RIP: 0010:write_comp_data kernel/kcov.c:236 [inline] RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x30/0x80 kernel/kcov.c:290 Code: 8b 15 e4 e5 77 7e 65 8b 05 e5 e5 77 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 5b 83 ba 1c 16 00 00 00 74 52 8b 82 f8 15 00 00 <83> f8 03 75 47 48 8b 8a 00 16 00 00 44 8b 8a fc 15 00 00 49 c1 e1 RSP: 0018:ffffc90003ccf7b0 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000061 RCX: dffffc0000000000 RDX: ffff88807bffd940 RSI: 0000000000000040 RDI: 000000000000005e RBP: 0000000000000040 R08: ffffffff83f3951b R09: fffffbfff1ce6d46 R10: 0000000000000000 R11: dffffc0000000001 R12: 000000000000000c R13: 000000000000000b R14: 0000000000000002 R15: ffff8880237f0ff0 tomoyo_encode2 security/tomoyo/realpath.c:36 [inline] tomoyo_encode+0x14b/0x530 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x594/0x5d0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x350/0xb80 security/tomoyo/file.c:922 tomoyo_path_rename+0x194/0x1e0 security/tomoyo/tomoyo.c:287 security_path_rename+0x16f/0x210 security/security.c:1217 do_renameat2+0x991/0x1440 fs/namei.c:5016 __do_sys_rename fs/namei.c:5075 [inline] __se_sys_rename fs/namei.c:5073 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5073 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3d42a9a93b Code: 48 8b 15 f0 64 15 00 83 c8 ff 64 83 3a 15 75 0e 48 8b 7c 24 08 e8 d5 d4 07 00 f7 d8 19 c0 48 83 c4 18 c3 b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 be 64 15 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffcfbc0e108 EFLAGS: 00000202 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 000055e823b63101 RCX: 00007f3d42a9a93b RDX: 000055ed7ab10790 RSI: 00007ffcfbc0e128 RDI: 00007ffcfbc0e528 RBP: 000055e824337aa0 R08: 0000000000000006 R09: c0c9452304dcdb09 R10: 000000000000010f R11: 0000000000000202 R12: 000055e824330ea0 R13: 00007ffcfbc0e128 R14: 00007ffcfbc0e528 R15: 000055e823b4dec8 WARNING: CPU: 1 PID: 13436 at kernel/softirq.c:376 __local_bh_enable_ip+0x1b3/0x1f0 Modules linked in: CPU: 1 PID: 13436 Comm: udevd Not tainted 6.1.84-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:__local_bh_enable_ip+0x1b3/0x1f0 kernel/softirq.c:376 Code: 04 25 28 00 00 00 48 3b 44 24 60 75 4a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 d0 fe ff ff e8 3f 00 00 00 eb a2 <0f> 0b e9 02 ff ff ff 48 c7 c1 e4 9e 73 8e 80 e1 07 80 c1 03 38 c1 RSP: 0018:ffffc90003ccf240 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 1ffff92000799e4c RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897f1fb RBP: ffffc90003ccf2f8 R08: dffffc0000000000 R09: ffffed100f075146 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff888023c62480 R14: ffffc90003ccf280 R15: 0000000000000201 FS: 00007f3d42f4ac80(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff8da579198 CR3: 000000005ee0c000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __sock_map_delete net/core/sock_map.c:426 [inline] sock_map_delete_elem+0xcb/0x130 net/core/sock_map.c:448 bpf_prog_8c0e092b1e199972+0x5b/0x5f bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 __traceiter_sched_switch+0x91/0xc0 include/trace/events/sched.h:222 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2116/0x4550 kernel/sched/core.c:6555 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870 irqentry_exit+0x53/0x80 kernel/entry/common.c:439 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline] RIP: 0010:write_comp_data kernel/kcov.c:236 [inline] RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x30/0x80 kernel/kcov.c:290 Code: 8b 15 e4 e5 77 7e 65 8b 05 e5 e5 77 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 5b 83 ba 1c 16 00 00 00 74 52 8b 82 f8 15 00 00 <83> f8 03 75 47 48 8b 8a 00 16 00 00 44 8b 8a fc 15 00 00 49 c1 e1 RSP: 0018:ffffc90003ccf7b0 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000061 RCX: dffffc0000000000 RDX: ffff88807bffd940 RSI: 0000000000000040 RDI: 000000000000005e RBP: 0000000000000040 R08: ffffffff83f3951b R09: fffffbfff1ce6d46 R10: 0000000000000000 R11: dffffc0000000001 R12: 000000000000000c R13: 000000000000000b R14: 0000000000000002 R15: ffff8880237f0ff0 tomoyo_encode2 security/tomoyo/realpath.c:36 [inline] tomoyo_encode+0x14b/0x530 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x594/0x5d0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x350/0xb80 security/tomoyo/file.c:922 tomoyo_path_rename+0x194/0x1e0 security/tomoyo/tomoyo.c:287 security_path_rename+0x16f/0x210 security/security.c:1217 do_renameat2+0x991/0x1440 fs/namei.c:5016 __do_sys_rename fs/namei.c:5075 [inline] __se_sys_rename fs/namei.c:5073 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5073 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3d42a9a93b Code: 48 8b 15 f0 64 15 00 83 c8 ff 64 83 3a 15 75 0e 48 8b 7c 24 08 e8 d5 d4 07 00 f7 d8 19 c0 48 83 c4 18 c3 b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 be 64 15 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffcfbc0e108 EFLAGS: 00000202 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 000055e823b63101 RCX: 00007f3d42a9a93b RDX: 000055ed7ab10790 RSI: 00007ffcfbc0e128 RDI: 00007ffcfbc0e528 RBP: 000055e824337aa0 R08: 0000000000000006 R09: c0c9452304dcdb09 R10: 000000000000010f R11: 0000000000000202 R12: 000055e824330ea0 R13: 00007ffcfbc0e128 R14: 00007ffcfbc0e528 R15: 000055e823b4dec8 ---------------- Code disassembly (best guess): 0: 8b 15 e4 e5 77 7e mov 0x7e77e5e4(%rip),%edx # 0x7e77e5ea 6: 65 8b 05 e5 e5 77 7e mov %gs:0x7e77e5e5(%rip),%eax # 0x7e77e5f2 d: a9 00 01 ff 00 test $0xff0100,%eax 12: 74 10 je 0x24 14: a9 00 01 00 00 test $0x100,%eax 19: 74 5b je 0x76 1b: 83 ba 1c 16 00 00 00 cmpl $0x0,0x161c(%rdx) 22: 74 52 je 0x76 24: 8b 82 f8 15 00 00 mov 0x15f8(%rdx),%eax * 2a: 83 f8 03 cmp $0x3,%eax <-- trapping instruction 2d: 75 47 jne 0x76 2f: 48 8b 8a 00 16 00 00 mov 0x1600(%rdx),%rcx 36: 44 8b 8a fc 15 00 00 mov 0x15fc(%rdx),%r9d 3d: 49 rex.WB 3e: c1 .byte 0xc1 3f: e1 .byte 0xe1