===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.6.0-rc2-syzkaller-00143-gb5cbe7c00aa0 #0 Not tainted ----------------------------------------------------- kworker/1:2/25491 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8dd82cb8 (disc_data_lock){.+.+}-{2:2}, at: ap_get drivers/net/ppp/ppp_async.c:136 [inline] ffffffff8dd82cb8 (disc_data_lock){.+.+}-{2:2}, at: ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:352 and this task is already holding: ffffffff9221a878 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2a0 drivers/tty/serial/serial_port.c:38 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+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 serial8250_handle_irq+0x81/0x6f0 drivers/tty/serial/8250/8250_port.c:1921 serial8250_default_handle_irq+0xcc/0x1e0 drivers/tty/serial/8250/8250_port.c:1967 serial8250_interrupt+0xa5/0x1e0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x286/0xa20 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+0x249/0xbf0 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+0x134/0x220 arch/x86/kernel/irq.c:257 common_interrupt+0xa3/0xc0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 __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] serial_port_runtime_resume+0x1fe/0x2a0 drivers/tty/serial/serial_port.c:41 __rpm_callback+0x2b9/0x7a0 drivers/base/power/runtime.c:392 rpm_callback drivers/base/power/runtime.c:446 [inline] rpm_resume+0x10ad/0x1af0 drivers/base/power/runtime.c:912 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:977 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 to a HARDIRQ-irq-unsafe lock: (disc_data_lock){.+.+}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:285 tty_ioctl+0x98c/0xda0 drivers/tty/tty_io.c:2785 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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); lock(&port_lock_key); *** DEADLOCK *** 4 locks held by kworker/1:2/25491: #0: ffff88814127e538 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2605 [inline] #0: ffff88814127e538 ((wq_completion)pm){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1400 kernel/workqueue.c:2703 #1: ffffc90005767d20 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2605 [inline] #1: ffffc90005767d20 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1400 kernel/workqueue.c:2703 #2: ffffffff9221a878 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2a0 drivers/tty/serial/serial_port.c:38 #3: ffff8880205e70a0 (&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+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 serial8250_handle_irq+0x81/0x6f0 drivers/tty/serial/8250/8250_port.c:1921 serial8250_default_handle_irq+0xcc/0x1e0 drivers/tty/serial/8250/8250_port.c:1967 serial8250_interrupt+0xa5/0x1e0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x286/0xa20 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+0x249/0xbf0 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+0x134/0x220 arch/x86/kernel/irq.c:257 common_interrupt+0xa3/0xc0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 __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] serial_port_runtime_resume+0x1fe/0x2a0 drivers/tty/serial/serial_port.c:41 __rpm_callback+0x2b9/0x7a0 drivers/base/power/runtime.c:392 rpm_callback drivers/base/power/runtime.c:446 [inline] rpm_resume+0x10ad/0x1af0 drivers/base/power/runtime.c:912 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:977 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 IN-SOFTIRQ-W at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 serial8250_console_write+0x1a8/0x1820 drivers/tty/serial/8250/8250_port.c:3408 console_emit_next_record kernel/printk/printk.c:2910 [inline] console_flush_all+0x7ff/0xec0 kernel/printk/printk.c:2966 console_unlock+0x13b/0x4d0 kernel/printk/printk.c:3035 vprintk_emit+0x508/0x720 kernel/printk/printk.c:2307 _printk+0xd5/0x120 kernel/printk/printk.c:2332 netdev_info+0x122/0x170 net/core/dev.c:11379 j1939_xtp_rx_abort_one+0x3cd/0x580 net/can/j1939/transport.c:1341 j1939_xtp_rx_abort net/can/j1939/transport.c:1362 [inline] j1939_tp_cmd_recv net/can/j1939/transport.c:2111 [inline] j1939_tp_recv+0x92a/0x1050 net/can/j1939/transport.c:2144 j1939_can_recv+0x732/0xb20 net/can/j1939/main.c:112 deliver net/can/af_can.c:572 [inline] can_rcv_filter+0x349/0x7c0 net/can/af_can.c:606 can_receive+0x319/0x470 net/can/af_can.c:663 can_rcv+0x144/0x260 net/can/af_can.c:687 __netif_receive_skb_one_core net/core/dev.c:5523 [inline] __netif_receive_skb+0x1ca/0x530 net/core/dev.c:5637 process_backlog+0x385/0x760 net/core/dev.c:5965 __napi_poll+0xc7/0x470 net/core/dev.c:6527 napi_poll net/core/dev.c:6594 [inline] net_rx_action+0x78b/0x1010 net/core/dev.c:6727 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu+0xf1/0x1b0 kernel/softirq.c:632 irq_exit_rcu+0x9/0x20 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 j1939_sk_send_loop net/can/j1939/socket.c:1150 [inline] j1939_sk_sendmsg+0xe01/0x14b0 net/can/j1939/socket.c:1263 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2541 ___sys_sendmsg net/socket.c:2595 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd INITIAL USE at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 serial8250_do_set_termios+0x52b/0x1790 drivers/tty/serial/8250/8250_port.c:2798 uart_set_options+0x3e5/0x720 drivers/tty/serial/serial_core.c:2278 serial8250_console_setup+0x3c2/0x650 drivers/tty/serial/8250/8250_port.c:3512 univ8250_console_setup+0x3ad/0x470 drivers/tty/serial/8250/8250_core.c:632 try_enable_preferred_console+0x40f/0x560 kernel/printk/printk.c:3294 register_console+0x452/0x1080 kernel/printk/printk.c:3467 univ8250_console_init+0x45/0x50 drivers/tty/serial/8250/8250_core.c:717 console_init+0x193/0x670 kernel/printk/printk.c:3667 start_kernel+0x2d2/0x4f0 init/main.c:1004 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:556 x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:537 secondary_startup_64_no_verify+0x167/0x16b } ... 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} { HARDIRQ-ON-R at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:285 tty_ioctl+0x98c/0xda0 drivers/tty/tty_io.c:2785 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd SOFTIRQ-ON-R at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:285 tty_ioctl+0x98c/0xda0 drivers/tty/tty_io.c:2785 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd INITIAL USE at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline] _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326 ppp_asynctty_close+0x29/0x180 drivers/net/ppp/ppp_async.c:219 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:1688 tty_release+0xd02/0x12c0 drivers/tty/tty_io.c:1859 __fput+0x3f8/0x910 fs/file_table.c:384 __do_sys_close fs/open.c:1572 [inline] __se_sys_close+0x15f/0x220 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd INITIAL READ USE at: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:285 tty_ioctl+0x98c/0xda0 drivers/tty/tty_io.c:2785 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd } ... key at: [] disc_data_lock+0x18/0x60 ... acquired at: __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:352 tty_wakeup+0xb7/0x100 drivers/tty/tty_io.c:523 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6b7/0x8b0 drivers/tty/serial/8250/8250_port.c:1843 __start_tx+0x312/0x450 drivers/tty/serial/8250/8250_port.c:1552 serial_port_runtime_resume+0x1ec/0x2a0 drivers/tty/serial/serial_port.c:40 __rpm_callback+0x2b9/0x7a0 drivers/base/power/runtime.c:392 rpm_callback drivers/base/power/runtime.c:446 [inline] rpm_resume+0x10ad/0x1af0 drivers/base/power/runtime.c:912 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:977 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 stack backtrace: CPU: 1 PID: 25491 Comm: kworker/1:2 Not tainted 6.6.0-rc2-syzkaller-00143-gb5cbe7c00aa0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Workqueue: pm pm_runtime_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 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 kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x73f1/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228 ap_get drivers/net/ppp/ppp_async.c:136 [inline] ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:352 tty_wakeup+0xb7/0x100 drivers/tty/tty_io.c:523 tty_port_default_wakeup+0xa6/0xf0 drivers/tty/tty_port.c:69 serial8250_tx_chars+0x6b7/0x8b0 drivers/tty/serial/8250/8250_port.c:1843 __start_tx+0x312/0x450 drivers/tty/serial/8250/8250_port.c:1552 serial_port_runtime_resume+0x1ec/0x2a0 drivers/tty/serial/serial_port.c:40 __rpm_callback+0x2b9/0x7a0 drivers/base/power/runtime.c:392 rpm_callback drivers/base/power/runtime.c:446 [inline] rpm_resume+0x10ad/0x1af0 drivers/base/power/runtime.c:912 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:977 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304