===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.8.0-syzkaller-05202-g9187210eee7d #0 Not tainted ----------------------------------------------------- kworker/1:1/41 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffffffff8ec12258 (disc_data_lock){.+.+}-{2:2}, at: ap_get drivers/net/ppp/ppp_async.c:137 [inline] ffffffff8ec12258 (disc_data_lock){.+.+}-{2:2}, at: ppp_asynctty_wakeup+0x20/0x210 drivers/net/ppp/ppp_async.c:353 and this task is already holding: ffffffff947eadf8 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:616 [inline] ffffffff947eadf8 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2b0 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+0x1e4/0x530 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:616 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1913 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1962 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x28a/0xa30 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:667 [inline] serial_port_runtime_resume+0x204/0x2b0 drivers/tty/serial/serial_port.c:41 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:393 rpm_callback drivers/base/power/runtime.c:447 [inline] rpm_resume+0x10b2/0x1af0 drivers/base/power/runtime.c:913 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:978 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 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:243 to a HARDIRQ-irq-unsafe lock: (disc_data_lock){.+.+}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x1e4/0x530 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_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:286 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 __do_compat_sys_ioctl fs/ioctl.c:1004 [inline] __se_compat_sys_ioctl+0x51c/0xca0 fs/ioctl.c:947 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xbe/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 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:1/41: #0: ffff888017ecf548 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3229 [inline] #0: ffff888017ecf548 ((wq_completion)pm){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x1770 kernel/workqueue.c:3335 #1: ffffc90000b17d00 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3230 [inline] #1: ffffc90000b17d00 ((work_completion)(&dev->power.work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x1770 kernel/workqueue.c:3335 #2: ffffffff947eadf8 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:616 [inline] #2: ffffffff947eadf8 (&port_lock_key){-.-.}-{2:2}, at: serial_port_runtime_resume+0x85/0x2b0 drivers/tty/serial/serial_port.c:38 #3: ffff888046e500a0 (&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+0x1e4/0x530 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:616 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1913 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1962 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x28a/0xa30 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:667 [inline] serial_port_runtime_resume+0x204/0x2b0 drivers/tty/serial/serial_port.c:41 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:393 rpm_callback drivers/base/power/runtime.c:447 [inline] rpm_resume+0x10b2/0x1af0 drivers/base/power/runtime.c:913 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:978 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 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:243 IN-SOFTIRQ-W at: lock_acquire+0x1e4/0x530 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:616 [inline] serial8250_handle_irq+0x81/0x710 drivers/tty/serial/8250/8250_port.c:1913 serial8250_default_handle_irq+0xd1/0x1f0 drivers/tty/serial/8250/8250_port.c:1962 serial8250_interrupt+0xa9/0x1f0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x28a/0xa30 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 arch_local_irq_enable arch/x86/include/asm/irqflags.h:77 [inline] __do_softirq+0x1db/0x943 kernel/softirq.c:538 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 seqcount_lockdep_reader_access+0x1d6/0x220 include/linux/seqlock.h:75 read_seqbegin include/linux/seqlock.h:772 [inline] read_seqbegin_or_lock include/linux/seqlock.h:1076 [inline] prepend_path+0x2d6/0xbe0 fs/d_path.c:171 d_absolute_path+0x179/0x310 fs/d_path.c:234 tomoyo_get_absolute_path security/tomoyo/realpath.c:101 [inline] tomoyo_realpath_from_path+0x2b4/0x5e0 security/tomoyo/realpath.c:271 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xd8/0x130 security/security.c:2238 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_statx+0x1a5/0x4e0 fs/stat.c:248 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_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 INITIAL USE at: lock_acquire+0x1e4/0x530 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:616 [inline] serial8250_do_set_termios+0x531/0x17e0 drivers/tty/serial/8250/8250_port.c:2793 uart_set_options+0x3eb/0x730 drivers/tty/serial/serial_core.c:2320 serial8250_console_setup+0x3db/0x670 drivers/tty/serial/8250/8250_port.c:3507 univ8250_console_setup+0x3ac/0x470 drivers/tty/serial/8250/8250_core.c:632 try_enable_preferred_console+0x40d/0x560 kernel/printk/printk.c:3291 register_console+0x261/0xcd0 kernel/printk/printk.c:3468 univ8250_console_init+0x49/0x50 drivers/tty/serial/8250/8250_core.c:717 console_init+0x198/0x680 kernel/printk/printk.c:3677 start_kernel+0x2d3/0x500 init/main.c:1012 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:509 x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:490 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+0x1e4/0x530 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_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:286 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 __do_compat_sys_ioctl fs/ioctl.c:1004 [inline] __se_compat_sys_ioctl+0x51c/0xca0 fs/ioctl.c:947 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xbe/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 SOFTIRQ-ON-R at: lock_acquire+0x1e4/0x530 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_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:286 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 __do_compat_sys_ioctl fs/ioctl.c:1004 [inline] __se_compat_sys_ioctl+0x51c/0xca0 fs/ioctl.c:947 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xbe/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 INITIAL USE at: lock_acquire+0x1e4/0x530 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+0x174/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:423 __do_sys_close fs/open.c:1557 [inline] __se_sys_close fs/open.c:1542 [inline] __ia32_sys_close+0x7f/0x110 fs/open.c:1542 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xbe/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 INITIAL READ USE at: lock_acquire+0x1e4/0x530 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_ioctl+0x36/0x3f0 drivers/net/ppp/ppp_async.c:286 tty_ioctl+0x99e/0xdc0 drivers/tty/tty_io.c:2812 __do_compat_sys_ioctl fs/ioctl.c:1004 [inline] __se_compat_sys_ioctl+0x51c/0xca0 fs/ioctl.c:947 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xbe/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7a/0x84 } ... key at: [] disc_data_lock+0x18/0x60 ... acquired at: lock_acquire+0x1e4/0x530 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:1835 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1544 serial_port_runtime_resume+0x1f0/0x2b0 drivers/tty/serial/serial_port.c:40 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:393 rpm_callback drivers/base/power/runtime.c:447 [inline] rpm_resume+0x10b2/0x1af0 drivers/base/power/runtime.c:913 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:978 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 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:243 stack backtrace: CPU: 1 PID: 41 Comm: kworker/1:1 Not tainted 6.8.0-syzkaller-05202-g9187210eee7d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: pm pm_runtime_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 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+0x4dc7/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1e4/0x530 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:1835 __start_tx+0x32e/0x470 drivers/tty/serial/8250/8250_port.c:1544 serial_port_runtime_resume+0x1f0/0x2b0 drivers/tty/serial/serial_port.c:40 __rpm_callback+0x2df/0x790 drivers/base/power/runtime.c:393 rpm_callback drivers/base/power/runtime.c:447 [inline] rpm_resume+0x10b2/0x1af0 drivers/base/power/runtime.c:913 pm_runtime_work+0x147/0x210 drivers/base/power/runtime.c:978 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 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:243