=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
syzkaller #0 Not tainted
-----------------------------------------------------
kworker/u4:2/154 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8ccce298 (disc_data_lock){.+.+}-{2:2}, at: sp_get drivers/net/hamradio/6pack.c:375 [inline]
ffffffff8ccce298 (disc_data_lock){.+.+}-{2:2}, at: sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396
and this task is already holding:
ffffffff965ff300 (&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}
but this new dependency connects a HARDIRQ-irq-safe lock:
(&port_lock_key){-.-.}-{2:2}
... which became HARDIRQ-irq-safe at:
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 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+0x299/0x9d0 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+0xbc/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [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+0xd2e/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:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 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}
... which became HARDIRQ-irq-unsafe at:
...
lock_acquire+0x19e/0x400 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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);
local_irq_disable();
lock(&port_lock_key);
lock(disc_data_lock);
<Interrupt>
lock(&port_lock_key);
*** DEADLOCK ***
6 locks held by kworker/u4:2/154:
#0: ffff888016c79138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x761/0x1010 kernel/workqueue.c:-1
#1: ffffc90002007d00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work+0x79f/0x1010 kernel/workqueue.c:2285
#2: ffff888146e80ca0 (&buf->lock){+.+.}-{3:3}, at: flush_to_ldisc+0x34/0x530 drivers/tty/tty_buffer.c:495
#3: ffff88802a548098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
#4: ffffffff965ff300 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x105/0x880 drivers/tty/serial/serial_core.c:571
#5: ffff88802a548098 (&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+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 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+0x299/0x9d0 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+0xbc/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [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+0xd2e/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:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 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+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 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+0x299/0x9d0 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
unwind_next_frame+0x3ce/0x1d90 arch/x86/kernel/unwind_orc.c:461
arch_stack_walk+0x10c/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0xa6/0xf0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
security_cred_free+0xbc/0xf0 security/security.c:1719
put_cred_rcu+0xdd/0x3e0 kernel/cred.c:115
rcu_do_batch kernel/rcu/tree.c:2523 [inline]
rcu_core+0x9d2/0x1670 kernel/rcu/tree.c:2763
handle_softirqs+0x339/0x830 kernel/softirq.c:576
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x13b/0x230 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
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xbc/0x120 kernel/locking/spinlock.c:194
__debug_check_no_obj_freed lib/debugobjects.c:982 [inline]
debug_check_no_obj_freed+0x515/0x530 lib/debugobjects.c:1003
slab_free_hook mm/slub.c:1685 [inline]
slab_free_freelist_hook+0x8b/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
tomoyo_find_next_domain+0x16cb/0x1a60 security/tomoyo/domain.c:884
tomoyo_bprm_check_security+0xdd/0x120 security/tomoyo/tomoyo.c:101
security_bprm_check+0x5e/0x90 security/security.c:868
search_binary_handler fs/exec.c:1730 [inline]
exec_binprm fs/exec.c:1783 [inline]
bprm_execve+0xa53/0x1840 fs/exec.c:1852
kernel_execve+0x82a/0x900 fs/exec.c:2013
call_usermodehelper_exec_async+0x207/0x350 kernel/umh.c:112
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
INITIAL USE at:
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
serial8250_do_set_termios+0x54b/0x1850 drivers/tty/serial/8250/8250_port.c:2772
uart_set_options+0x3d1/0x5e0 drivers/tty/serial/serial_core.c:2154
serial8250_console_setup+0x2bc/0x3a0 drivers/tty/serial/8250/8250_port.c:3447
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/0x980 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+0x2fc/0x540 init/main.c:1090
secondary_startup_64_no_verify+0xb1/0xbb
}
... key at: [<ffffffff965fe7e0>] 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+0x19e/0x400 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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+0x19e/0x400 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
INITIAL READ USE at:
lock_acquire+0x19e/0x400 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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: [<ffffffff8ccce298>] 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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: 1 PID: 154 Comm: kworker/u4:2 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: events_unbound flush_to_ldisc
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 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+0x6688/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 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+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>