=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
6.6.96-syzkaller #0 Not tainted
-----------------------------------------------------
kworker/u4:8/6103 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8d7d9218 (disc_data_lock){.+.+}-{2:2}, at: sp_get drivers/net/hamradio/6pack.c:376 [inline]
ffffffff8d7d9218 (disc_data_lock){.+.+}-{2:2}, at: sixpack_write_wakeup+0x30/0x480 drivers/net/hamradio/6pack.c:397
and this task is already holding:
ffffffff971d60b8 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0xfb/0x5d0 drivers/tty/serial/serial_core.c:613
which would create a new lock dependency:
(&port_lock_key){-.-.}-{2:2} -> (disc_data_lock){.+.+}-{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/0x410 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
serial8250_handle_irq+0x7a/0x6e0 drivers/tty/serial/8250/8250_port.c:1915
serial8250_default_handle_irq+0xb8/0x1a0 drivers/tty/serial/8250/8250_port.c:1964
serial8250_interrupt+0x9f/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x276/0x930 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x8b/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x247/0xb30 kernel/irq/chip.c:831
generic_handle_irq_desc include/linux/irqdesc.h:161 [inline]
handle_irq arch/x86/kernel/irq.c:240 [inline]
__common_interrupt+0x13b/0x230 arch/x86/kernel/irq.c:259
common_interrupt+0xb4/0xd0 arch/x86/kernel/irq.c:249
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:678
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xa9/0x110 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x45b/0x5d0 drivers/tty/serial/serial_core.c:634
process_output_block drivers/tty/n_tty.c:580 [inline]
n_tty_write+0xd27/0x11d0 drivers/tty/n_tty.c:2395
iterate_tty_write drivers/tty/tty_io.c:1017 [inline]
file_tty_write+0x54b/0x980 drivers/tty/tty_io.c:1088
call_write_iter include/linux/fs.h:2018 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x43b/0x940 fs/read_write.c:584
ksys_write+0x147/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
to a HARDIRQ-irq-unsafe lock:
(disc_data_lock){.+.+}-{2:2}
... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_receive_buf+0x59/0x1360 drivers/net/hamradio/6pack.c:439
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
other info that might help us debug this:
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(disc_data_lock);
local_irq_disable();
lock(&port_lock_key);
lock(disc_data_lock);
<Interrupt>
lock(&port_lock_key);
*** DEADLOCK ***
6 locks held by kworker/u4:8/6103:
#0: ffff888017871538 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
#0: ffff888017871538 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711
#1: ffffc90003527d00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
#1: ffffc90003527d00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711
#2: ffff888020ff0ce8 (&buf->lock){+.+.}-{3:3}, at: flush_to_ldisc+0x38/0x830 drivers/tty/tty_buffer.c:467
#3: ffff8880778150a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263
#4: ffffffff971d60b8 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0xfb/0x5d0 drivers/tty/serial/serial_core.c:613
#5: ffff8880778150a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263
the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&port_lock_key){-.-.}-{2:2} {
IN-HARDIRQ-W at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
serial8250_handle_irq+0x7a/0x6e0 drivers/tty/serial/8250/8250_port.c:1915
serial8250_default_handle_irq+0xb8/0x1a0 drivers/tty/serial/8250/8250_port.c:1964
serial8250_interrupt+0x9f/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x276/0x930 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x8b/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x247/0xb30 kernel/irq/chip.c:831
generic_handle_irq_desc include/linux/irqdesc.h:161 [inline]
handle_irq arch/x86/kernel/irq.c:240 [inline]
__common_interrupt+0x13b/0x230 arch/x86/kernel/irq.c:259
common_interrupt+0xb4/0xd0 arch/x86/kernel/irq.c:249
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:678
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xa9/0x110 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x45b/0x5d0 drivers/tty/serial/serial_core.c:634
process_output_block drivers/tty/n_tty.c:580 [inline]
n_tty_write+0xd27/0x11d0 drivers/tty/n_tty.c:2395
iterate_tty_write drivers/tty/tty_io.c:1017 [inline]
file_tty_write+0x54b/0x980 drivers/tty/tty_io.c:1088
call_write_iter include/linux/fs.h:2018 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x43b/0x940 fs/read_write.c:584
ksys_write+0x147/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
IN-SOFTIRQ-W at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
serial8250_console_write+0x16d/0x17a0 drivers/tty/serial/8250/8250_port.c:3434
console_emit_next_record kernel/printk/printk.c:2944 [inline]
console_flush_all+0x6cd/0xd00 kernel/printk/printk.c:3000
console_unlock+0xae/0x340 kernel/printk/printk.c:3069
vprintk_emit+0x477/0x600 kernel/printk/printk.c:2341
dev_vprintk_emit+0x338/0x3e0 drivers/base/core.c:4953
dev_printk_emit+0xe1/0x130 drivers/base/core.c:4964
_dev_err+0x10b/0x160 drivers/base/core.c:5019
__usb_hcd_giveback_urb+0x35f/0x520 drivers/usb/core/hcd.c:1650
dummy_timer+0x8a3/0x31b0 drivers/usb/gadget/udc/dummy_hcd.c:1993
__run_hrtimer kernel/time/hrtimer.c:1755 [inline]
__hrtimer_run_queues+0x51e/0xc40 kernel/time/hrtimer.c:1819
hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1836
handle_softirqs+0x280/0x820 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xa9/0x110 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
usb_hcd_unlink_urb+0xae/0x1c0 drivers/usb/core/hcd.c:1607
usb_kill_urb+0x10d/0x2f0 drivers/usb/core/urb.c:712
usbtouch_close+0xb5/0x1c0 drivers/input/touchscreen/usbtouchscreen.c:1565
input_close_device+0x123/0x1d0 drivers/input/input.c:712
mousedev_close_device+0x90/0xd0 drivers/input/mousedev.c:444
mousedev_release+0x16d/0x180 drivers/input/mousedev.c:528
__fput+0x234/0x970 fs/file_table.c:384
__do_sys_close fs/open.c:1571 [inline]
__se_sys_close+0x15f/0x220 fs/open.c:1556
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
INITIAL USE at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
serial8250_do_set_termios+0x548/0x17e0 drivers/tty/serial/8250/8250_port.c:2804
uart_set_options+0x3bc/0x5b0 drivers/tty/serial/serial_core.c:2339
serial8250_console_setup+0x2d2/0x3a0 drivers/tty/serial/8250/8250_port.c:3538
univ8250_console_setup+0x3c4/0x480 drivers/tty/serial/8250/8250_core.c:632
console_call_setup kernel/printk/printk.c:3311 [inline]
try_enable_preferred_console+0x48a/0x600 kernel/printk/printk.c:3352
register_console+0x3be/0xe60 kernel/printk/printk.c:3526
univ8250_console_init+0x45/0x50 drivers/tty/serial/8250/8250_core.c:717
console_init+0x17b/0x5e0 kernel/printk/printk.c:3726
start_kernel+0x2c0/0x4e0 init/main.c:1010
x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:555
copy_bootdata+0x0/0xe0 arch/x86/kernel/head64.c:536
secondary_startup_64_no_verify+0x179/0x17b
}
... key at: [<ffffffff971d54c0>] port_lock_key+0x0/0x20
the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (disc_data_lock){.+.+}-{2:2} {
HARDIRQ-ON-R at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_receive_buf+0x59/0x1360 drivers/net/hamradio/6pack.c:439
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
SOFTIRQ-ON-R at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_receive_buf+0x59/0x1360 drivers/net/hamradio/6pack.c:439
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
INITIAL USE at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
_raw_write_lock_irq+0xa3/0xe0 kernel/locking/spinlock.c:326
sixpack_close+0x2c/0x2a0 drivers/net/hamradio/6pack.c:653
tty_ldisc_kill+0xa3/0x1a0 drivers/tty/tty_ldisc.c:613
tty_ldisc_release+0x1a4/0x200 drivers/tty/tty_ldisc.c:781
tty_release_struct+0x2a/0xd0 drivers/tty/tty_io.c:1688
tty_release+0xc79/0x1610 drivers/tty/tty_io.c:1859
__fput+0x234/0x970 fs/file_table.c:384
task_work_run+0x1ce/0x250 kernel/task_work.c:239
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x68/0xd2
INITIAL READ USE at:
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_receive_buf+0x59/0x1360 drivers/net/hamradio/6pack.c:439
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
}
... key at: [<ffffffff8d7d9218>] disc_data_lock+0x18/0x100
... acquired at:
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_write_wakeup+0x30/0x480 drivers/net/hamradio/6pack.c:397
tty_wakeup+0xb8/0x100 drivers/tty/tty_io.c:523
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:69
serial8250_tx_chars+0x6bd/0x8a0 drivers/tty/serial/8250/8250_port.c:1837
__start_tx+0x313/0x450 drivers/tty/serial/8250/8250_port.c:1546
__uart_start+0x23a/0x3e0 drivers/tty/serial/serial_core.c:160
uart_write+0x449/0x5d0 drivers/tty/serial/serial_core.c:633
decode_prio_command drivers/net/hamradio/6pack.c:888 [inline]
sixpack_decode drivers/net/hamradio/6pack.c:963 [inline]
sixpack_receive_buf+0x424/0x1360 drivers/net/hamradio/6pack.c:453
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
stack backtrace:
CPU: 0 PID: 6103 Comm: kworker/u4:8 Not tainted 6.6.96-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+0x16c/0x230 lib/dump_stack.c:106
print_bad_irq_dependency kernel/locking/lockdep.c:2626 [inline]
check_irq_usage kernel/locking/lockdep.c:2865 [inline]
check_prev_add kernel/locking/lockdep.c:3138 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x678f/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
_raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
sp_get drivers/net/hamradio/6pack.c:376 [inline]
sixpack_write_wakeup+0x30/0x480 drivers/net/hamradio/6pack.c:397
tty_wakeup+0xb8/0x100 drivers/tty/tty_io.c:523
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:69
serial8250_tx_chars+0x6bd/0x8a0 drivers/tty/serial/8250/8250_port.c:1837
__start_tx+0x313/0x450 drivers/tty/serial/8250/8250_port.c:1546
__uart_start+0x23a/0x3e0 drivers/tty/serial/serial_core.c:160
uart_write+0x449/0x5d0 drivers/tty/serial/serial_core.c:633
decode_prio_command drivers/net/hamradio/6pack.c:888 [inline]
sixpack_decode drivers/net/hamradio/6pack.c:963 [inline]
sixpack_receive_buf+0x424/0x1360 drivers/net/hamradio/6pack.c:453
tty_ldisc_receive_buf+0x117/0x160 drivers/tty/tty_buffer.c:391
tty_port_default_receive_buf+0x6e/0xa0 drivers/tty/tty_port.c:37
receive_buf drivers/tty/tty_buffer.c:445 [inline]
flush_to_ldisc+0x2f2/0x830 drivers/tty/tty_buffer.c:495
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
</TASK>