[v5.15] possible deadlock in serial8250_handle_irq (2)

2 views
Skip to first unread message

syzbot

unread,
Oct 8, 2025, 8:28:32 PM (7 days ago) Oct 8
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 29e53a5b1c4f Linux 5.15.194
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15723a7c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e1bb6d24ef2164eb
dashboard link: https://syzkaller.appspot.com/bug?extid=928e94bcd66d9a567ae0
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8cd4e3ff852c/disk-29e53a5b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/21e1f773622c/vmlinux-29e53a5b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8f418c0a25cc/bzImage-29e53a5b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+928e94...@syzkaller.appspotmail.com

=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
syzkaller #0 Not tainted
-----------------------------------------------------
kworker/u4:14/4627 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8cac63b8 (disc_data_lock#2){.+.+}-{2:2}, at: sp_get drivers/net/hamradio/6pack.c:375 [inline]
ffffffff8cac63b8 (disc_data_lock#2){.+.+}-{2:2}, at: sixpack_write_wakeup+0x2c/0x400 drivers/net/hamradio/6pack.c:396

and this task is already holding:
ffffffff963eb2c0 (&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+0x59/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
rcu_core+0xfb2/0x15d0 kernel/rcu/tree.c:2767
handle_softirqs+0x328/0x820 kernel/softirq.c:576
__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:729
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

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:14/4627:
#0: ffff888016879138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x760/0x1000 kernel/workqueue.c:-1
#1: ffffc90004db7d00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work+0x7a3/0x1000 kernel/workqueue.c:2285
#2: ffff888146f88ca0 (&buf->lock){+.+.}-{3:3}, at: flush_to_ldisc+0x34/0x530 drivers/tty/tty_buffer.c:495
#3: ffff88807b6f1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
#4: ffffffff963eb2c0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x105/0x880 drivers/tty/serial/serial_core.c:571
#5: ffff88807b6f1098 (&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+0x59/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
rcu_core+0xfb2/0x15d0 kernel/rcu/tree.c:2767
handle_softirqs+0x328/0x820 kernel/softirq.c:576
__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:729
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
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
rcu_core+0xfb2/0x15d0 kernel/rcu/tree.c:2767
handle_softirqs+0x328/0x820 kernel/softirq.c:576
__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:729
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:2772
uart_set_options+0x3c2/0x5d0 drivers/tty/serial/serial_core.c:2154
serial8250_console_setup+0x2ce/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/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: [<ffffffff963ea7a0>] port_lock_key+0x0/0x20

the dependencies between the lock to be acquired
and HARDIRQ-irq-unsafe lock:
-> (disc_data_lock#2){.+.+}-{2:2} {
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 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: [<ffffffff8cac63b8>] 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: 4627 Comm: kworker/u4:14 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages