===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.14.0-syzkaller-01103-g2df0c02dab82 #0 Not tainted ----------------------------------------------------- kworker/u8:4/14875 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8f6c52d8 (disc_data_lock#3){.+.+}-{3:3}, at: sp_get drivers/net/hamradio/6pack.c:370 [inline] ffffffff8f6c52d8 (disc_data_lock#3){.+.+}-{3:3}, at: sixpack_write_wakeup+0x30/0x440 drivers/net/hamradio/6pack.c:391 and this task is already holding: ffffffff9a7f6058 (&port_lock_key){-.-.}-{3:3}, at: uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] ffffffff9a7f6058 (&port_lock_key){-.-.}-{3:3}, at: uart_write+0x107/0xa40 drivers/tty/serial/serial_core.c:626 which would create a new lock dependency: (&port_lock_key){-.-.}-{3:3} -> (disc_data_lock#3){.+.+}-{3:3} but this new dependency connects a HARDIRQ-irq-safe lock: (&port_lock_key){-.-.}-{3:3} ... which became HARDIRQ-irq-safe at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd8/0x130 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6d/0xb80 drivers/tty/serial/8250/8250_port.c:1923 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1972 serial8250_interrupt+0xab/0x1f0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x29e/0xa60 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x89/0x1f0 kernel/irq/handle.c:210 handle_edge_irq+0x25f/0xc20 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:266 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:292 common_interrupt+0xb4/0xd0 arch/x86/kernel/irq.c:285 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:106 [inline] acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:111 acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:701 cpuidle_enter_state+0x113/0x480 drivers/cpuidle/cpuidle.c:268 cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:389 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:230 [inline] do_idle+0x374/0x5d0 kernel/sched/idle.c:325 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:423 start_secondary+0xfe/0x100 arch/x86/kernel/smpboot.c:315 common_startup_64+0x13e/0x147 to a HARDIRQ-irq-unsafe lock: (disc_data_lock#3){.+.+}-{3:3} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_receive_buf+0x57/0x1420 drivers/net/hamradio/6pack.c:433 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(disc_data_lock#3); local_irq_disable(); lock(&port_lock_key); lock(disc_data_lock#3); lock(&port_lock_key); *** DEADLOCK *** 6 locks held by kworker/u8:4/14875: #0: ffff88801ac81148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3213 [inline] #0: ffff88801ac81148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x990/0x18e0 kernel/workqueue.c:3319 #1: ffffc90002f6fc60 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3214 [inline] #1: ffffc90002f6fc60 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9cb/0x18e0 kernel/workqueue.c:3319 #2: ffff888024f30ca0 (&buf->lock){+.+.}-{4:4}, at: flush_to_ldisc+0x38/0x860 drivers/tty/tty_buffer.c:467 #3: ffff88805cdb30a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263 #4: ffffffff9a7f6058 (&port_lock_key){-.-.}-{3:3}, at: uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] #4: ffffffff9a7f6058 (&port_lock_key){-.-.}-{3:3}, at: uart_write+0x107/0xa40 drivers/tty/serial/serial_core.c:626 #5: ffff88805cdb30a0 (&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){-.-.}-{3:3} { IN-HARDIRQ-W at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd8/0x130 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6d/0xb80 drivers/tty/serial/8250/8250_port.c:1923 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1972 serial8250_interrupt+0xab/0x1f0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x29e/0xa60 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x89/0x1f0 kernel/irq/handle.c:210 handle_edge_irq+0x25f/0xc20 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:266 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:292 common_interrupt+0xb4/0xd0 arch/x86/kernel/irq.c:285 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:106 [inline] acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:111 acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:701 cpuidle_enter_state+0x113/0x480 drivers/cpuidle/cpuidle.c:268 cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:389 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:230 [inline] do_idle+0x374/0x5d0 kernel/sched/idle.c:325 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:423 start_secondary+0xfe/0x100 arch/x86/kernel/smpboot.c:315 common_startup_64+0x13e/0x147 IN-SOFTIRQ-W at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd8/0x130 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6d/0xb80 drivers/tty/serial/8250/8250_port.c:1923 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1972 serial8250_interrupt+0xab/0x1f0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x29e/0xa60 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x89/0x1f0 kernel/irq/handle.c:210 handle_edge_irq+0x25f/0xc20 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:266 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:292 common_interrupt+0x5e/0xd0 arch/x86/kernel/irq.c:285 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 arch_local_irq_enable arch/x86/include/asm/irqflags.h:97 [inline] handle_softirqs+0x1f1/0x9b0 kernel/softirq.c:545 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xfb/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 _compound_head include/linux/page-flags.h:243 [inline] virt_to_folio include/linux/mm.h:1297 [inline] virt_to_slab mm/slab.h:211 [inline] kmem_cache_free+0x91/0x410 mm/slub.c:4735 file_free fs/file_table.c:68 [inline] __fput+0x63f/0x9f0 fs/file_table.c:478 fput_close_sync+0x1ef/0x270 fs/file_table.c:570 __do_sys_close fs/open.c:1581 [inline] __se_sys_close fs/open.c:1566 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1566 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f INITIAL USE at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd8/0x130 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_do_set_termios+0x4dc/0x1c70 drivers/tty/serial/8250/8250_port.c:2782 uart_set_options+0x439/0x780 drivers/tty/serial/serial_core.c:2311 serial8250_console_setup+0x3dd/0x670 drivers/tty/serial/8250/8250_port.c:3528 univ8250_console_setup+0x429/0x530 drivers/tty/serial/8250/8250_core.c:428 console_call_setup kernel/printk/printk.c:3771 [inline] try_enable_preferred_console+0x46b/0x5c0 kernel/printk/printk.c:3815 register_console+0x37d/0x1080 kernel/printk/printk.c:4009 univ8250_console_init+0x52/0x90 drivers/tty/serial/8250/8250_core.c:513 console_init+0x1b8/0x6f0 kernel/printk/printk.c:4290 start_kernel+0x2dd/0x510 init/main.c:1034 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:513 x86_64_start_kernel+0x66/0x70 arch/x86/kernel/head64.c:494 common_startup_64+0x13e/0x147 } ... key at: [] port_lock_key+0x0/0x20 the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: -> (disc_data_lock#3){.+.+}-{3:3} { HARDIRQ-ON-R at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_receive_buf+0x57/0x1420 drivers/net/hamradio/6pack.c:433 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 SOFTIRQ-ON-R at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_receive_buf+0x57/0x1420 drivers/net/hamradio/6pack.c:433 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 INITIAL READ USE at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_receive_buf+0x57/0x1420 drivers/net/hamradio/6pack.c:433 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 } ... key at: [] disc_data_lock+0x18/0x100 ... acquired at: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_write_wakeup+0x30/0x440 drivers/net/hamradio/6pack.c:391 tty_wakeup+0xbd/0x100 drivers/tty/tty_io.c:517 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6e2/0x930 drivers/tty/serial/8250/8250_port.c:1844 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1549 __uart_start+0x2be/0x450 drivers/tty/serial/serial_core.c:160 uart_write+0x280/0xa40 drivers/tty/serial/serial_core.c:635 decode_prio_command drivers/net/hamradio/6pack.c:868 [inline] sixpack_decode drivers/net/hamradio/6pack.c:943 [inline] sixpack_receive_buf+0x449/0x1420 drivers/net/hamradio/6pack.c:447 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 stack backtrace: CPU: 0 UID: 0 PID: 14875 Comm: kworker/u8:4 Not tainted 6.14.0-syzkaller-01103-g2df0c02dab82 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: events_unbound flush_to_ldisc Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_bad_irq_dependency kernel/locking/lockdep.c:2652 [inline] check_irq_usage kernel/locking/lockdep.c:2893 [inline] check_prev_add kernel/locking/lockdep.c:3170 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0x22bb/0x24e0 kernel/locking/lockdep.c:3909 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __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:370 [inline] sixpack_write_wakeup+0x30/0x440 drivers/net/hamradio/6pack.c:391 tty_wakeup+0xbd/0x100 drivers/tty/tty_io.c:517 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6e2/0x930 drivers/tty/serial/8250/8250_port.c:1844 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1549 __uart_start+0x2be/0x450 drivers/tty/serial/serial_core.c:160 uart_write+0x280/0xa40 drivers/tty/serial/serial_core.c:635 decode_prio_command drivers/net/hamradio/6pack.c:868 [inline] sixpack_decode drivers/net/hamradio/6pack.c:943 [inline] sixpack_receive_buf+0x449/0x1420 drivers/net/hamradio/6pack.c:447 tty_ldisc_receive_buf+0x121/0x170 drivers/tty/tty_buffer.c:391 tty_port_default_receive_buf+0x6d/0xa0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:445 [inline] flush_to_ldisc+0x32d/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7ab/0x920 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245