------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.1.83-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/3643 is trying to acquire lock:
ffffffff8d11ede0 (console_owner){....}-{0:0}, at: console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
ffffffff8d11ede0 (console_owner){....}-{0:0}, at: console_emit_next_record+0xa9c/0x1000 kernel/printk/printk.c:2768
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:
-> #4 (&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
-> #3 (&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
__wake_up_common+0x2a0/0x4e0 kernel/sched/wait.c:107
__wake_up_common_lock kernel/sched/wait.c:138 [inline]
__wake_up+0x11a/0x1c0 kernel/sched/wait.c:160
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:71
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
free_unref_page_prepare+0x1/0x1120 mm/page_alloc.c:3355
free_unref_page_list+0x663/0x900 mm/page_alloc.c:3499
release_pages+0x2836/0x2b40 mm/swap.c:1055
tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261
tlb_finish_mmu+0xce/0x1f0 mm/mmu_gather.c:361
exit_mmap+0x3c3/0x9f0 mm/mmap.c:3239
__mmput+0x115/0x3c0 kernel/fork.c:1199
exit_mm+0x226/0x300 kernel/exit.c:563
do_exit+0x9f6/0x26a0 kernel/exit.c:856
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
__do_sys_exit_group kernel/exit.c:1030 [inline]
__se_sys_exit_group kernel/exit.c:1028 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028
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
-> #2 (&tty->write_wait){-.-.}-{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
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xfd/0x1c0 kernel/sched/wait.c:160
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:71
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:600
process_output_block drivers/tty/n_tty.c:586 [inline]
n_tty_write+0xd7f/0x1260 drivers/tty/n_tty.c:2367
do_tty_write drivers/tty/tty_io.c:1018 [inline]
file_tty_write+0x504/0x890 drivers/tty/tty_io.c:1089
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x7ae/0xba0 fs/read_write.c:584
ksys_write+0x19c/0x2c0 fs/read_write.c:637
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
-> #1 (&port_lock_key){-.-.}-{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
serial8250_console_write+0x19d/0x1750 drivers/tty/serial/8250/8250_port.c:3410
call_console_driver kernel/printk/printk.c:1971 [inline]
console_emit_next_record+0xbb4/0x1000 kernel/printk/printk.c:2771
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2900
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2297
_printk+0xd1/0x111 kernel/printk/printk.c:2322
register_console+0x69e/0x990 kernel/printk/printk.c:3248
univ8250_console_init+0x41/0x43 drivers/tty/serial/8250/8250_core.c:687
console_init+0x1d6/0x7f3 kernel/printk/printk.c:3338
start_kernel+0x30b/0x53f init/main.c:1075
secondary_startup_64_no_verify+0xcf/0xdb
-> #0 (console_owner){....}-{0:0}:
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
console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
console_emit_next_record+0xabd/0x1000 kernel/printk/printk.c:2768
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2900
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2297
_printk+0xd1/0x111 kernel/printk/printk.c:2322
__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_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_a8aaa52f2e199321+0x42/0x46
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
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2116/0x4550 kernel/sched/core.c:6555
preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727
preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
try_to_wake_up+0x87e/0x12e0 kernel/sched/core.c:4234
wake_up_process kernel/sched/core.c:4362 [inline]
wake_up_q+0x8b/0xd0 kernel/sched/core.c:1007
futex_wake+0x4ea/0x590 kernel/futex/waitwake.c:184
do_futex+0x375/0x490 kernel/futex/syscalls.c:111
__do_sys_futex kernel/futex/syscalls.c:183 [inline]
__se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164
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_owner --> &p->pi_lock --> &rq->__lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&rq->__lock);
lock(&p->pi_lock);
lock(&rq->__lock);
lock(console_owner);
*** DEADLOCK ***
3 locks held by syz-executor.2/3643:
#0: ffff8880b993aa18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537
#1: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#1: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#1: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
#1: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314
#2: ffffffff8d006b40 (console_lock){+.+.}-{0:0}, at: _printk+0xd1/0x111 kernel/printk/printk.c:2322
stack backtrace:
CPU: 1 PID: 3643 Comm: syz-executor.2 Not tainted 6.1.83-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
console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
console_emit_next_record+0xabd/0x1000 kernel/printk/printk.c:2768
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2900
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2297
_printk+0xd1/0x111 kernel/printk/printk.c:2322
__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 a4 99 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc900043ff5c0 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 1ffff9200087febc RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897e790
RBP: ffffc900043ff680 R08: dffffc0000000000 R09: ffffed100b51b06b
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000006 R14: ffffc900043ff600 R15: 0000000000000201
sock_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_a8aaa52f2e199321+0x42/0x46
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
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2116/0x4550 kernel/sched/core.c:6555
preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727
preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
try_to_wake_up+0x87e/0x12e0 kernel/sched/core.c:4234
wake_up_process kernel/sched/core.c:4362 [inline]
wake_up_q+0x8b/0xd0 kernel/sched/core.c:1007
futex_wake+0x4ea/0x590 kernel/futex/waitwake.c:184
do_futex+0x375/0x490 kernel/futex/syscalls.c:111
__do_sys_futex kernel/futex/syscalls.c:183 [inline]
__se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164
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:0x7f5b61e7dde9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5b62c6f178 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f5b61fabf88 RCX: 00007f5b61e7dde9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5b61fabf8c
RBP: 00007f5b61fabf80 R08: 0000000000000010 R09: 00007f5b62c6f6c0
R10: 0000000000000005 R11: 0000000000000246 R12: 00007f5b61fabf8c
R13: 000000000000000b R14: 00007ffe87372fb0 R15: 00007ffe87373098
WARNING: CPU: 1 PID: 3643 at kernel/softirq.c:376 __local_bh_enable_ip+0x1b3/0x1f0
Modules linked in:
CPU: 1 PID: 3643 Comm: syz-executor.2 Not tainted 6.1.83-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 a4 99 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc900043ff5c0 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 1ffff9200087febc RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897e790
RBP: ffffc900043ff680 R08: dffffc0000000000 R09: ffffed100b51b06b
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000006 R14: ffffc900043ff600 R15: 0000000000000201
FS: 00007f5b62c6f6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b31c21000 CR3: 0000000072217000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
sock_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_a8aaa52f2e199321+0x42/0x46
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
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2116/0x4550 kernel/sched/core.c:6555
preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727
preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
try_to_wake_up+0x87e/0x12e0 kernel/sched/core.c:4234
wake_up_process kernel/sched/core.c:4362 [inline]
wake_up_q+0x8b/0xd0 kernel/sched/core.c:1007
futex_wake+0x4ea/0x590 kernel/futex/waitwake.c:184
do_futex+0x375/0x490 kernel/futex/syscalls.c:111
__do_sys_futex kernel/futex/syscalls.c:183 [inline]
__se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164
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:0x7f5b61e7dde9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5b62c6f178 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f5b61fabf88 RCX: 00007f5b61e7dde9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5b61fabf8c
RBP: 00007f5b61fabf80 R08: 0000000000000010 R09: 00007f5b62c6f6c0
R10: 0000000000000005 R11: 0000000000000246 R12: 00007f5b61fabf8c
R13: 000000000000000b R14: 00007ffe87372fb0 R15: 00007ffe87373098