===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.15.0-rc3-syzkaller-00094-g02ddfb981de8 #0 Not tainted ----------------------------------------------------- kworker/u8:8/5921 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8ecda9b8 (disc_data_lock#3){.+.+}-{3:3}, at: sp_get drivers/net/hamradio/6pack.c:370 [inline] ffffffff8ecda9b8 (disc_data_lock#3){.+.+}-{3:3}, at: sixpack_write_wakeup+0x30/0x480 drivers/net/hamradio/6pack.c:391 and this task is already holding: ffffffff99d756d8 (&port_lock_key){-.-.}-{3:3}, at: uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] ffffffff99d756d8 (&port_lock_key){-.-.}-{3:3}, at: uart_write+0xfa/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+0x120/0x360 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6b/0xbb0 drivers/tty/serial/8250/8250_port.c:1921 serial8250_default_handle_irq+0xbf/0x1b0 drivers/tty/serial/8250/8250_port.c:1970 serial8250_interrupt+0xa5/0x1d0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x28c/0x980 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+0x24d/0xb60 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+0x143/0x250 arch/x86/kernel/irq.c:292 common_interrupt+0xb6/0xe0 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] pv_native_safe_halt+0x13/0x20 arch/x86/kernel/paravirt.c:80 arch_safe_halt arch/x86/include/asm/paravirt.h:107 [inline] default_idle+0x13/0x20 arch/x86/kernel/process.c:748 default_idle_call+0x74/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:185 [inline] do_idle+0x1e8/0x510 kernel/sched/idle.c:325 cpu_startup_entry+0x44/0x60 kernel/sched/idle.c:423 start_secondary+0x101/0x110 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+0x120/0x360 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_ioctl+0x84/0x590 drivers/net/hamradio/6pack.c:676 tty_ioctl+0x9c6/0xde0 drivers/tty/tty_io.c:2811 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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:8/5921: #0: ffff88801a481148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3213 [inline] #0: ffff88801a481148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b1/0x17a0 kernel/workqueue.c:3319 #1: ffffc90004f7fc60 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3214 [inline] #1: ffffc90004f7fc60 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ec/0x17a0 kernel/workqueue.c:3319 #2: ffff8880244c0ca0 (&buf->lock){+.+.}-{4:4}, at: flush_to_ldisc+0x38/0x810 drivers/tty/tty_buffer.c:467 #3: ffff88805c1ab0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x90 drivers/tty/tty_ldisc.c:263 #4: ffffffff99d756d8 (&port_lock_key){-.-.}-{3:3}, at: uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] #4: ffffffff99d756d8 (&port_lock_key){-.-.}-{3:3}, at: uart_write+0xfa/0xa40 drivers/tty/serial/serial_core.c:626 #5: ffff88805c1ab0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x90 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+0x120/0x360 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6b/0xbb0 drivers/tty/serial/8250/8250_port.c:1921 serial8250_default_handle_irq+0xbf/0x1b0 drivers/tty/serial/8250/8250_port.c:1970 serial8250_interrupt+0xa5/0x1d0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x28c/0x980 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+0x24d/0xb60 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+0x143/0x250 arch/x86/kernel/irq.c:292 common_interrupt+0xb6/0xe0 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] pv_native_safe_halt+0x13/0x20 arch/x86/kernel/paravirt.c:80 arch_safe_halt arch/x86/include/asm/paravirt.h:107 [inline] default_idle+0x13/0x20 arch/x86/kernel/process.c:748 default_idle_call+0x74/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:185 [inline] do_idle+0x1e8/0x510 kernel/sched/idle.c:325 cpu_startup_entry+0x44/0x60 kernel/sched/idle.c:423 start_secondary+0x101/0x110 arch/x86/kernel/smpboot.c:315 common_startup_64+0x13e/0x147 IN-SOFTIRQ-W at: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_handle_irq+0x6b/0xbb0 drivers/tty/serial/8250/8250_port.c:1921 serial8250_default_handle_irq+0xbf/0x1b0 drivers/tty/serial/8250/8250_port.c:1970 serial8250_interrupt+0xa5/0x1d0 drivers/tty/serial/8250/8250_core.c:86 __handle_irq_event_percpu+0x28c/0x980 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+0x24d/0xb60 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+0x143/0x250 arch/x86/kernel/irq.c:292 common_interrupt+0x5e/0xe0 arch/x86/kernel/irq.c:285 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 check_preemption_disabled+0x3a/0x120 lib/smp_processor_id.c:55 rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline] rcu_is_watching+0x15/0xb0 kernel/rcu/tree.c:736 trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x4b/0x3e0 kernel/locking/lockdep.c:5877 rcu_lock_release include/linux/rcupdate.h:341 [inline] rcu_read_unlock include/linux/rcupdate.h:871 [inline] class_rcu_destructor include/linux/rcupdate.h:1155 [inline] unwind_next_frame+0x19a9/0x2390 arch/x86/kernel/unwind_orc.c:680 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3082 [inline] call_rcu+0x142/0x990 kernel/rcu/tree.c:3202 exit_creds+0x146/0x1c0 kernel/cred.c:-1 __put_task_struct+0x105/0x460 kernel/fork.c:999 put_task_struct include/linux/sched/task.h:145 [inline] delayed_put_task_struct+0x11f/0x2f0 kernel/exit.c:225 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xca8/0x1710 kernel/rcu/tree.c:2824 handle_softirqs+0x286/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 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 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] pv_native_safe_halt+0x13/0x20 arch/x86/kernel/paravirt.c:80 arch_safe_halt arch/x86/include/asm/paravirt.h:107 [inline] default_idle+0x13/0x20 arch/x86/kernel/process.c:748 default_idle_call+0x74/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:185 [inline] do_idle+0x1e8/0x510 kernel/sched/idle.c:325 cpu_startup_entry+0x44/0x60 kernel/sched/idle.c:423 start_secondary+0x101/0x110 arch/x86/kernel/smpboot.c:315 common_startup_64+0x13e/0x147 INITIAL USE at: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:715 [inline] serial8250_do_set_termios+0x4bb/0x1c20 drivers/tty/serial/8250/8250_port.c:2778 uart_set_options+0x3c2/0x5b0 drivers/tty/serial/serial_core.c:2310 serial8250_console_setup+0x2f4/0x3c0 drivers/tty/serial/8250/8250_port.c:3519 univ8250_console_setup+0x43a/0x540 drivers/tty/serial/8250/8250_core.c:428 console_call_setup kernel/printk/printk.c:3799 [inline] try_enable_preferred_console+0x4e4/0x650 kernel/printk/printk.c:3843 register_console+0x551/0xf90 kernel/printk/printk.c:4037 univ8250_console_init+0x52/0x90 drivers/tty/serial/8250/8250_core.c:513 console_init+0x1a1/0x670 kernel/printk/printk.c:4323 start_kernel+0x2cb/0x4f0 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+0x120/0x360 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_ioctl+0x84/0x590 drivers/net/hamradio/6pack.c:676 tty_ioctl+0x9c6/0xde0 drivers/tty/tty_io.c:2811 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f SOFTIRQ-ON-R at: lock_acquire+0x120/0x360 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_ioctl+0x84/0x590 drivers/net/hamradio/6pack.c:676 tty_ioctl+0x9c6/0xde0 drivers/tty/tty_io.c:2811 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f INITIAL USE at: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline] _raw_write_lock_irq+0xa2/0xf0 kernel/locking/spinlock.c:326 sixpack_close+0x2c/0x280 drivers/net/hamradio/6pack.c:641 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:1690 tty_release+0xcb0/0x1640 drivers/tty/tty_io.c:1861 __fput+0x44c/0xa70 fs/file_table.c:465 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work+0x5e/0x80 include/linux/resume_user_mode.h:50 exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x9a/0x120 kernel/entry/common.c:218 do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f INITIAL READ USE at: lock_acquire+0x120/0x360 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_ioctl+0x84/0x590 drivers/net/hamradio/6pack.c:676 tty_ioctl+0x9c6/0xde0 drivers/tty/tty_io.c:2811 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f } ... key at: [] disc_data_lock+0x18/0x100 6pack.c:-1 ... acquired at: lock_acquire+0x120/0x360 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/0x480 drivers/net/hamradio/6pack.c:391 tty_wakeup+0xbe/0x100 drivers/tty/tty_io.c:517 tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x72e/0x970 drivers/tty/serial/8250/8250_port.c:1842 __start_tx+0x33b/0x480 drivers/tty/serial/8250/8250_port.c:1547 __uart_start+0x23f/0x440 drivers/tty/serial/serial_core.c:160 uart_write+0x278/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+0x447/0x1450 drivers/net/hamradio/6pack.c:447 tty_ldisc_receive_buf+0x119/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+0x2c5/0x810 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xade/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4e/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 stack backtrace: CPU: 1 UID: 0 PID: 5921 Comm: kworker/u8:8 Not tainted 6.15.0-rc3-syzkaller-00094-g02ddfb981de8 #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_lvl+0x189/0x250 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+0x1f05/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 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/0x480 drivers/net/hamradio/6pack.c:391 tty_wakeup+0xbe/0x100 drivers/tty/tty_io.c:517 tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x72e/0x970 drivers/tty/serial/8250/8250_port.c:1842 __start_tx+0x33b/0x480 drivers/tty/serial/8250/8250_port.c:1547 __uart_start+0x23f/0x440 drivers/tty/serial/serial_core.c:160 uart_write+0x278/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+0x447/0x1450 drivers/net/hamradio/6pack.c:447 tty_ldisc_receive_buf+0x119/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+0x2c5/0x810 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xade/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4e/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245