===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.9.0-rc2-next-20240405-syzkaller #0 Not tainted ----------------------------------------------------- kworker/u8:5/1036 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8ee35358 (disc_data_lock#2){.+.+}-{2:2}, at: sp_get drivers/net/hamradio/6pack.c:376 [inline] ffffffff8ee35358 (disc_data_lock#2){.+.+}-{2:2}, at: sixpack_write_wakeup+0x30/0x430 drivers/net/hamradio/6pack.c:397 and this task is already holding: ffffffff94a99618 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] ffffffff94a99618 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x101/0x5c0 drivers/tty/serial/serial_core.c:595 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+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1903 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1952 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x29a/0xa80 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:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:257 common_interrupt+0xa5/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] uart_port_unlock_irqrestore include/linux/serial_core.h:670 [inline] serial_port_runtime_resume+0x204/0x2b0 drivers/tty/serial/serial_port.c:44 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:394 rpm_callback drivers/base/power/runtime.c:448 [inline] rpm_resume+0xfca/0x1670 drivers/base/power/runtime.c:914 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:979 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 to a HARDIRQ-irq-unsafe lock: (disc_data_lock#2){.+.+}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x1ed/0x550 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_ioctl+0x81/0x550 drivers/net/hamradio/6pack.c:689 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a 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); lock(&port_lock_key); *** DEADLOCK *** 6 locks held by kworker/u8:5/1036: #0: ffff888015089148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3193 [inline] #0: ffff888015089148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3299 #1: ffffc90004b0fd00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3194 [inline] #1: ffffc90004b0fd00 ((work_completion)(&buf->work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3299 #2: ffff88801fba0ce8 (&buf->lock){+.+.}-{3:3}, at: flush_to_ldisc+0x38/0x860 drivers/tty/tty_buffer.c:467 #3: ffff88806ba9a0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1c/0x80 drivers/tty/tty_ldisc.c:263 #4: ffffffff94a99618 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] #4: ffffffff94a99618 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x101/0x5c0 drivers/tty/serial/serial_core.c:595 #5: ffff88806ba9a0a0 (&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+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1903 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1952 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x29a/0xa80 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:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:257 common_interrupt+0xa5/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] uart_port_unlock_irqrestore include/linux/serial_core.h:670 [inline] serial_port_runtime_resume+0x204/0x2b0 drivers/tty/serial/serial_port.c:44 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:394 rpm_callback drivers/base/power/runtime.c:448 [inline] rpm_resume+0xfca/0x1670 drivers/base/power/runtime.c:914 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:979 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 IN-SOFTIRQ-W at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1903 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1952 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x29a/0xa80 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:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x138/0x230 arch/x86/kernel/irq.c:257 common_interrupt+0x4f/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 rcu_report_qs_rdp kernel/rcu/tree.c:2078 [inline] rcu_check_quiescent_state kernel/rcu/tree.c:2119 [inline] rcu_core+0x13d7/0x1830 kernel/rcu/tree.c:2473 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 bio_associate_blkg_from_css+0x0/0xc70 bio_associate_blkg+0x170/0x230 block/blk-cgroup.c:2076 bio_init block/bio.c:265 [inline] bio_alloc_bioset+0x4cf/0x1130 block/bio.c:569 bio_alloc include/linux/bio.h:437 [inline] submit_bh_wbc+0x277/0x560 fs/buffer.c:2784 ext4_read_bh_lock+0x8d/0xc0 fs/ext4/super.c:211 ext4_bread_batch+0x24c/0x4e0 fs/ext4/inode.c:921 __ext4_find_entry+0xfd5/0x1b30 fs/ext4/namei.c:1670 ext4_lookup_entry fs/ext4/namei.c:1770 [inline] ext4_lookup+0x15f/0x750 fs/ext4/namei.c:1838 lookup_open fs/namei.c:3475 [inline] open_last_lookups fs/namei.c:3566 [inline] path_openat+0x1033/0x3280 fs/namei.c:3796 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a INITIAL USE at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] serial8250_do_set_termios+0x4c2/0x1720 drivers/tty/serial/8250/8250_port.c:2745 uart_set_options+0x3eb/0x730 drivers/tty/serial/serial_core.c:2320 serial8250_console_setup+0x3db/0x670 drivers/tty/serial/8250/8250_port.c:3459 univ8250_console_setup+0x3ac/0x470 drivers/tty/serial/8250/8250_core.c:632 console_call_setup kernel/printk/printk.c:3287 [inline] try_enable_preferred_console+0x409/0x560 kernel/printk/printk.c:3328 register_console+0x261/0xcf0 kernel/printk/printk.c:3506 univ8250_console_init+0x49/0x50 drivers/tty/serial/8250/8250_core.c:717 console_init+0x1b8/0x6f0 kernel/printk/printk.c:3715 start_kernel+0x2d3/0x500 init/main.c:1029 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:507 x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:488 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#2){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x1ed/0x550 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_ioctl+0x81/0x550 drivers/net/hamradio/6pack.c:689 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a SOFTIRQ-ON-R at: lock_acquire+0x1ed/0x550 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_ioctl+0x81/0x550 drivers/net/hamradio/6pack.c:689 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a INITIAL USE at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline] _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326 sixpack_close+0x2c/0x260 drivers/net/hamradio/6pack.c:653 tty_ldisc_kill+0xa3/0x1a0 drivers/tty/tty_ldisc.c:607 tty_ldisc_release+0x1a1/0x200 drivers/tty/tty_ldisc.c:775 tty_release_struct+0x2b/0xe0 drivers/tty/tty_io.c:1696 tty_release+0xd0c/0x12c0 drivers/tty/tty_io.c:1867 __fput+0x406/0x8b0 fs/file_table.c:422 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1541 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a INITIAL READ USE at: lock_acquire+0x1ed/0x550 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_ioctl+0x81/0x550 drivers/net/hamradio/6pack.c:689 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a } ... key at: [] disc_data_lock+0x18/0x100 ... acquired at: lock_acquire+0x1ed/0x550 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/0x430 drivers/net/hamradio/6pack.c:397 tty_wakeup+0xbb/0x100 drivers/tty/tty_io.c:523 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6ad/0x8a0 drivers/tty/serial/8250/8250_port.c:1825 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1534 __uart_start+0x2d6/0x3c0 drivers/tty/serial/serial_core.c:160 uart_write+0x427/0x5c0 drivers/tty/serial/serial_core.c:615 decode_prio_command drivers/net/hamradio/6pack.c:888 [inline] sixpack_decode drivers/net/hamradio/6pack.c:963 [inline] sixpack_receive_buf+0x427/0x1380 drivers/net/hamradio/6pack.c:453 tty_ldisc_receive_buf+0x11f/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+0x328/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 stack backtrace: CPU: 1 PID: 1036 Comm: kworker/u8:5 Not tainted 6.9.0-rc2-next-20240405-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events_unbound flush_to_ldisc Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 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+0x4dc7/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 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/0x430 drivers/net/hamradio/6pack.c:397 tty_wakeup+0xbb/0x100 drivers/tty/tty_io.c:523 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6ad/0x8a0 drivers/tty/serial/8250/8250_port.c:1825 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1534 __uart_start+0x2d6/0x3c0 drivers/tty/serial/serial_core.c:160 uart_write+0x427/0x5c0 drivers/tty/serial/serial_core.c:615 decode_prio_command drivers/net/hamradio/6pack.c:888 [inline] sixpack_decode drivers/net/hamradio/6pack.c:963 [inline] sixpack_receive_buf+0x427/0x1380 drivers/net/hamradio/6pack.c:453 tty_ldisc_receive_buf+0x11f/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+0x328/0x860 drivers/tty/tty_buffer.c:495 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243