=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
5.15.185-syzkaller #0 Not tainted
-----------------------------------------------------
kworker/u4:6/4231 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8cac6658 (disc_data_lock#2){.?.+}-{2:2}, at: sp_get drivers/net/hamradio/6pack.c:375 [inline]
ffffffff8cac6658 (disc_data_lock#2){.?.+}-{2:2}, at: sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396
and this task is already holding:
ffffffff963c9420 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x105/0x880 drivers/tty/serial/serial_core.c:571
which would create a new lock dependency:
(&port_lock_key){-.-.}-{2:2} -> (disc_data_lock#2){.?.+}-{2:2}
but this new dependency connects a HARDIRQ-irq-safe lock:
(&port_lock_key){-.-.}-{2:2}
... which became HARDIRQ-irq-safe at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
serial8250_handle_irq+0x6c/0x610 drivers/tty/serial/8250/8250_port.c:1895
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xa5/0x100 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
uart_write+0x62f/0x880 drivers/tty/serial/serial_core.c:592
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd21/0x1210 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x557/0x910 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2172 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x712/0xd00 fs/read_write.c:594
ksys_write+0x14d/0x250 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
to a HARDIRQ-irq-unsafe lock:
(disc_data_lock#2){.?.+}-{2:2}
... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_receive_buf+0x4d/0x12f0 drivers/net/hamradio/6pack.c:438
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
other info that might help us debug this:
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(disc_data_lock#2);
local_irq_disable();
lock(&port_lock_key);
lock(disc_data_lock#2);
<Interrupt>
lock(&port_lock_key);
*** DEADLOCK ***
6 locks held by kworker/u4:6/4231:
#0: ffff888016879138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x760/0x1000 kernel/workqueue.c:-1
#1: ffffc9000320fd00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work+0x7a3/0x1000 kernel/workqueue.c:2285
#2: ffff88801fc40ca0 (&buf->lock){+.+.}-{3:3}, at: flush_to_ldisc+0x34/0x530 drivers/tty/tty_buffer.c:495
#3: ffff888075ef1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
#4: ffffffff963c9420 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x105/0x880 drivers/tty/serial/serial_core.c:571
#5: ffff888075ef1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&port_lock_key){-.-.}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
serial8250_handle_irq+0x6c/0x610 drivers/tty/serial/8250/8250_port.c:1895
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xa5/0x100 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
uart_write+0x62f/0x880 drivers/tty/serial/serial_core.c:592
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd21/0x1210 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x557/0x910 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2172 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x712/0xd00 fs/read_write.c:594
ksys_write+0x14d/0x250 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
IN-SOFTIRQ-W at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
serial8250_handle_irq+0x6c/0x610 drivers/tty/serial/8250/8250_port.c:1895
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0x59/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
ffs arch/x86/include/asm/bitops.h:297 [inline]
handle_softirqs+0x1a9/0x820 kernel/softirq.c:564
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x12f/0x220 kernel/softirq.c:659
irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
default_idle+0xb/0x10 arch/x86/kernel/process.c:722
default_idle_call+0x81/0xc0 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x21b/0x5b0 kernel/sched/idle.c:306
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:403
start_kernel+0x486/0x530 init/main.c:1140
secondary_startup_64_no_verify+0xb1/0xbb
INITIAL USE at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
serial8250_do_set_termios+0x54d/0x1840 drivers/tty/serial/8250/8250_port.c:2773
uart_set_options+0x3c2/0x5d0 drivers/tty/serial/serial_core.c:2154
serial8250_console_setup+0x2ce/0x3a0 drivers/tty/serial/8250/8250_port.c:3448
univ8250_console_setup+0xe9/0x180 drivers/tty/serial/8250/8250_core.c:605
console_call_setup+0xd3/0xf0 kernel/printk/printk.c:2897
try_enable_preferred_console+0x43c/0x5a0 kernel/printk/printk.c:2938
register_console+0x2fd/0x960 kernel/printk/printk.c:3037
univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690
console_init+0x177/0x5d0 kernel/printk/printk.c:3207
start_kernel+0x2f9/0x530 init/main.c:1076
secondary_startup_64_no_verify+0xb1/0xbb
}
... key at: [<ffffffff963c8900>] port_lock_key+0x0/0x20
the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (disc_data_lock#2){.?.+}-{2:2} {
IN-HARDIRQ-R at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396
tty_wakeup+0xb4/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0xa5/0xf0 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1828
serial8250_handle_irq+0x519/0x610 drivers/tty/serial/8250/8250_port.c:1924
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0x59/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
HARDIRQ-ON-R at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_receive_buf+0x4d/0x12f0 drivers/net/hamradio/6pack.c:438
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
SOFTIRQ-ON-R at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_receive_buf+0x4d/0x12f0 drivers/net/hamradio/6pack.c:438
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
INITIAL USE at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline]
_raw_write_lock_irq+0x9f/0xe0 kernel/locking/spinlock.c:316
sixpack_close+0x28/0x1e0 drivers/net/hamradio/6pack.c:651
tty_ldisc_kill+0xa6/0x1a0 drivers/tty/tty_ldisc.c:629
tty_ldisc_release+0x1a0/0x200 drivers/tty/tty_ldisc.c:803
tty_release_struct+0x26/0xd0 drivers/tty/tty_io.c:1708
tty_release+0xd0c/0x16c0 drivers/tty/tty_io.c:1880
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
INITIAL READ USE at:
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_receive_buf+0x4d/0x12f0 drivers/net/hamradio/6pack.c:438
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
}
... key at: [<ffffffff8cac6658>] disc_data_lock+0x18/0x100
... acquired at:
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396
tty_wakeup+0xb4/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0xa5/0xf0 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1828
__start_tx drivers/tty/serial/8250/8250_port.c:1548 [inline]
serial8250_start_tx+0x7e9/0xa20 drivers/tty/serial/8250/8250_port.c:1652
__uart_start drivers/tty/serial/serial_core.c:132 [inline]
uart_write+0x61e/0x880 drivers/tty/serial/serial_core.c:591
decode_prio_command drivers/net/hamradio/6pack.c:886 [inline]
sixpack_decode drivers/net/hamradio/6pack.c:959 [inline]
sixpack_receive_buf+0x421/0x12f0 drivers/net/hamradio/6pack.c:452
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
stack backtrace:
CPU: 0 PID: 4231 Comm: kworker/u4:6 Not tainted 5.15.185-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: events_unbound flush_to_ldisc
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_bad_irq_dependency kernel/locking/lockdep.c:2567 [inline]
check_irq_usage kernel/locking/lockdep.c:2806 [inline]
check_prev_add kernel/locking/lockdep.c:3057 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x65dd/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_read_lock include/linux/rwlock_api_smp.h:149 [inline]
_raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:375 [inline]
sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396
tty_wakeup+0xb4/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0xa5/0xf0 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1828
__start_tx drivers/tty/serial/8250/8250_port.c:1548 [inline]
serial8250_start_tx+0x7e9/0xa20 drivers/tty/serial/8250/8250_port.c:1652
__uart_start drivers/tty/serial/serial_core.c:132 [inline]
uart_write+0x61e/0x880 drivers/tty/serial/serial_core.c:591
decode_prio_command drivers/net/hamradio/6pack.c:886 [inline]
sixpack_decode drivers/net/hamradio/6pack.c:959 [inline]
sixpack_receive_buf+0x421/0x12f0 drivers/net/hamradio/6pack.c:452
tty_ldisc_receive_buf+0x113/0x150 drivers/tty/tty_buffer.c:455
tty_port_default_receive_buf+0x69/0x90 drivers/tty/tty_port.c:39
receive_buf drivers/tty/tty_buffer.c:471 [inline]
flush_to_ldisc+0x2a7/0x530 drivers/tty/tty_buffer.c:523
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>