===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Not tainted ----------------------------------------------------- kworker/1:11/8130 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8ee20218 (disc_data_lock){.+.+}-{2:2}, at: ap_get drivers/net/ppp/ppp_async.c:137 [inline] ffffffff8ee20218 (disc_data_lock){.+.+}-{2:2}, at: ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:353 and this task is already holding: ffffffff94a21278 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] ffffffff94a21278 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2b0 drivers/tty/serial/serial_port.c:41 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+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:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 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:244 to a HARDIRQ-irq-unsafe lock: (disc_data_lock){.+.+}-{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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_receive+0x40/0x2000 drivers/net/ppp/ppp_async.c:336 tiocsti+0x24d/0x300 drivers/tty/tty_io.c:2299 tty_ioctl+0x51e/0xdc0 drivers/tty/tty_io.c:2717 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 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); local_irq_disable(); lock(&port_lock_key); lock(disc_data_lock); lock(&port_lock_key); *** DEADLOCK *** 4 locks held by kworker/1:11/8130: #0: ffff888016281548 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3229 [inline] #0: ffff888016281548 ((wq_completion)pm){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x17c0 kernel/workqueue.c:3335 #1: ffffc90004957d00 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3230 [inline] #1: ffffc90004957d00 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x17c0 kernel/workqueue.c:3335 #2: ffffffff94a21278 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:619 [inline] #2: ffffffff94a21278 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2b0 drivers/tty/serial/serial_port.c:41 #3: ffff88805e4170a0 (&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:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 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:244 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 debug_object_deactivate+0x2d5/0x390 lib/debugobjects.c:778 debug_rcu_head_unqueue kernel/rcu/rcu.h:239 [inline] rcu_do_batch kernel/rcu/tree.c:2188 [inline] rcu_core+0xa7f/0x1830 kernel/rcu/tree.c:2471 __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 preempt_count arch/x86/include/asm/preempt.h:26 [inline] check_kcov_mode kernel/kcov.c:173 [inline] __sanitizer_cov_trace_pc+0x18/0x70 kernel/kcov.c:207 unwind_next_frame+0x1e5b/0x2a00 arch/x86/kernel/unwind_orc.c:665 arch_stack_walk+0x151/0x1b0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122 save_stack+0xfb/0x1f0 mm/page_owner.c:156 __set_page_owner+0x8d/0x810 mm/page_owner.c:325 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc_lru+0x253/0x350 mm/slub.c:3864 alloc_inode_sb include/linux/fs.h:3091 [inline] ext4_alloc_inode+0x2e/0x580 fs/ext4/super.c:1408 alloc_inode fs/inode.c:261 [inline] iget_locked+0x1ad/0x850 fs/inode.c:1280 __ext4_iget+0x264/0x3ff0 fs/ext4/inode.c:4689 ext4_lookup+0x3e3/0x750 fs/ext4/namei.c:1854 __lookup_slow+0x28c/0x3f0 fs/namei.c:1692 lookup_slow+0x53/0x70 fs/namei.c:1709 walk_component+0x2e1/0x410 fs/namei.c:2004 lookup_last fs/namei.c:2461 [inline] path_lookupat+0x16f/0x450 fs/namei.c:2485 filename_lookup+0x256/0x610 fs/namei.c:2514 vfs_statx+0x105/0x4e0 fs/stat.c:244 vfs_fstatat+0x135/0x190 fs/stat.c:304 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x117/0x190 fs/stat.c:462 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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:1016 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} { 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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_receive+0x40/0x2000 drivers/net/ppp/ppp_async.c:336 tiocsti+0x24d/0x300 drivers/tty/tty_io.c:2299 tty_ioctl+0x51e/0xdc0 drivers/tty/tty_io.c:2717 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_receive+0x40/0x2000 drivers/net/ppp/ppp_async.c:336 tiocsti+0x24d/0x300 drivers/tty/tty_io.c:2299 tty_ioctl+0x51e/0xdc0 drivers/tty/tty_io.c:2717 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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 ppp_asynctty_close+0x29/0x190 drivers/net/ppp/ppp_async.c:220 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+0x429/0x8a0 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_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_receive+0x40/0x2000 drivers/net/ppp/ppp_async.c:336 tiocsti+0x24d/0x300 drivers/tty/tty_io.c:2299 tty_ioctl+0x51e/0xdc0 drivers/tty/tty_io.c:2717 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f } ... key at: [] disc_data_lock+0x18/0x60 ... 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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:353 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 serial_port_runtime_resume+0x1f0/0x2b0 drivers/tty/serial/serial_port.c:43 __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:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 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:244 stack backtrace: CPU: 1 PID: 8130 Comm: kworker/1:11 Not tainted 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: pm pm_runtime_work 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 ap_get drivers/net/ppp/ppp_async.c:137 [inline] ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:353 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 serial_port_runtime_resume+0x1f0/0x2b0 drivers/tty/serial/serial_port.c:43 __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:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 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:244