RDX: 000000000208e24b RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f2ec8c4a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffe09cf27ff R14: 00007f2ec8c4a300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/17790 is trying to acquire lock: 000000005c2ccf93 (console_owner){-.-.}, at: console_trylock_spinning kernel/printk/printk.c:1697 [inline] 000000005c2ccf93 (console_owner){-.-.}, at: vprintk_emit+0x3fe/0x740 kernel/printk/printk.c:1964 but task is already holding lock: 000000003f80b5af (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 drivers/tty/pty.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&port->lock)->rlock){-.-.}: tty_port_tty_get+0x1d/0x80 drivers/tty/tty_port.c:289 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:47 serial8250_tx_chars+0x490/0xaf0 drivers/tty/serial/8250/8250_port.c:1813 serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1900 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1873 [inline] serial8250_default_handle_irq+0xae/0x220 drivers/tty/serial/8250/8250_port.c:1916 serial8250_interrupt+0x101/0x240 drivers/tty/serial/8250/8250_core.c:125 __handle_irq_event_percpu+0x27e/0x8e0 kernel/irq/handle.c:149 handle_irq_event_percpu kernel/irq/handle.c:189 [inline] handle_irq_event+0x102/0x290 kernel/irq/handle.c:206 handle_edge_irq+0x260/0xcf0 kernel/irq/chip.c:800 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline] handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0x93/0x1c0 arch/x86/kernel/irq.c:246 ret_from_intr+0x0/0x1e arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0xa3/0xe0 kernel/locking/spinlock.c:184 spin_unlock_irqrestore include/linux/spinlock.h:384 [inline] uart_write+0x3bb/0x6f0 drivers/tty/serial/serial_core.c:612 do_output_char+0x5de/0x850 drivers/tty/n_tty.c:445 process_output drivers/tty/n_tty.c:512 [inline] n_tty_write+0x46e/0xff0 drivers/tty/n_tty.c:2343 do_tty_write drivers/tty/tty_io.c:960 [inline] tty_write+0x496/0x810 drivers/tty/tty_io.c:1044 redirected_tty_write+0xaa/0xb0 drivers/tty/tty_io.c:1065 do_loop_readv_writev fs/read_write.c:704 [inline] do_loop_readv_writev fs/read_write.c:688 [inline] do_iter_write+0x461/0x5d0 fs/read_write.c:962 vfs_writev+0x153/0x2e0 fs/read_write.c:1005 do_writev+0x136/0x330 fs/read_write.c:1040 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&port_lock_key){-.-.}: serial8250_console_write+0x90e/0xb70 drivers/tty/serial/8250/8250_port.c:3290 call_console_drivers kernel/printk/printk.c:1764 [inline] console_unlock+0xbb6/0x1110 kernel/printk/printk.c:2460 vprintk_emit+0x2d1/0x740 kernel/printk/printk.c:1965 vprintk_func+0x79/0x180 kernel/printk/printk_safe.c:405 printk+0xba/0xed kernel/printk/printk.c:2040 register_console+0x87f/0xc90 kernel/printk/printk.c:2776 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:684 console_init+0x4cb/0x718 kernel/printk/printk.c:2862 start_kernel+0x686/0x911 init/main.c:659 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 -> #0 (console_owner){-.-.}: console_trylock_spinning kernel/printk/printk.c:1718 [inline] vprintk_emit+0x43b/0x740 kernel/printk/printk.c:1964 vprintk_func+0x79/0x180 kernel/printk/printk_safe.c:405 printk+0xba/0xed kernel/printk/printk.c:2040 fail_dump lib/fault-inject.c:44 [inline] should_fail+0x66b/0x7b0 lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x6d/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:170 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:268 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:313 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x126/0x1f0 drivers/tty/pty.c:122 n_hdlc_send_frames+0x278/0x470 drivers/tty/n_hdlc.c:403 n_hdlc_tty_write+0x55e/0x640 drivers/tty/n_hdlc.c:713 do_tty_write drivers/tty/tty_io.c:960 [inline] tty_write+0x496/0x810 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &(&port->lock)->rlock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&port->lock)->rlock); lock(&port_lock_key); lock(&(&port->lock)->rlock); lock(console_owner); *** DEADLOCK *** 3 locks held by syz-executor.5/17790: #0: 000000001dd3b9dc (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:272 #1: 000000006ee71068 (&tty->atomic_write_lock){+.+.}, at: tty_write_lock drivers/tty/tty_io.c:886 [inline] #1: 000000006ee71068 (&tty->atomic_write_lock){+.+.}, at: do_tty_write drivers/tty/tty_io.c:909 [inline] #1: 000000006ee71068 (&tty->atomic_write_lock){+.+.}, at: tty_write+0x24e/0x810 drivers/tty/tty_io.c:1044 #2: 000000003f80b5af (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 drivers/tty/pty.c:120 stack backtrace: CPU: 1 PID: 17790 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2420 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 console_trylock_spinning kernel/printk/printk.c:1718 [inline] vprintk_emit+0x43b/0x740 kernel/printk/printk.c:1964 vprintk_func+0x79/0x180 kernel/printk/printk_safe.c:405 printk+0xba/0xed kernel/printk/printk.c:2040 fail_dump lib/fault-inject.c:44 [inline] should_fail+0x66b/0x7b0 lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x6d/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:170 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:268 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:313 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x126/0x1f0 drivers/tty/pty.c:122 n_hdlc_send_frames+0x278/0x470 drivers/tty/n_hdlc.c:403 n_hdlc_tty_write+0x55e/0x640 drivers/tty/n_hdlc.c:713 do_tty_write drivers/tty/tty_io.c:960 [inline] tty_write+0x496/0x810 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f2eca6d80c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2ec8c4a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2eca7f7f80 RCX: 00007f2eca6d80c9 RDX: 000000000208e24b RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f2ec8c4a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffe09cf27ff R14: 00007f2ec8c4a300 R15: 0000000000022000 CPU: 0 PID: 17789 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0xf lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x2ab/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] do_tty_write drivers/tty/tty_io.c:942 [inline] tty_write+0x59e/0x810 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f47eb6fd0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f47e9c6f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f47eb81cf80 RCX: 00007f47eb6fd0c9 RDX: 000000000208e24b RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f47e9c6f1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffee136d0af R14: 00007f47e9c6f300 R15: 0000000000022000 CPU: 1 PID: 17800 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0xf lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc+0x277/0x370 mm/slab.c:3557 ptlock_alloc mm/memory.c:4969 [inline] ptlock_init include/linux/mm.h:1900 [inline] pgtable_pmd_page_ctor include/linux/mm.h:1994 [inline] pmd_alloc_one arch/x86/include/asm/pgalloc.h:105 [inline] __pmd_alloc+0xbb/0x440 mm/memory.c:4417 pmd_alloc include/linux/mm.h:1850 [inline] __handle_mm_fault+0x1760/0x41c0 mm/memory.c:4266 handle_mm_fault+0x436/0xb10 mm/memory.c:4336 __do_page_fault+0x68e/0xd60 arch/x86/mm/fault.c:1412 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1205 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 0f 01 cb 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 01 ca c3 66 2e 0f 1f 84 00 00 00 00 00 0f 01 cb 83 RSP: 0018:ffff88804ca47c20 EFLAGS: 00050206 RAX: ffffed1013787740 RBX: 0000000000000800 RCX: 0000000000000800 RDX: 0000000000000800 RSI: 00000000200000c0 RDI: ffff88809bc3b200 RBP: 00000000200000c0 R08: 0000000000000001 R09: ffffed101378773f R10: ffff88809bc3b9ff R11: 0000000000000000 R12: 00000000200008c0 R13: ffff88809bc3b200 R14: 00007ffffffff000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:71 [inline] _copy_from_user+0xfc/0x130 lib/usercopy.c:13 copy_from_user include/linux/uaccess.h:147 [inline] do_tty_write drivers/tty/tty_io.c:958 [inline] tty_write+0x446/0x810 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fd3358a80c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd333e1a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fd3359c7f80 RCX: 00007fd3358a80c9 RDX: 000000000208e24b RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fd333e1a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff3a7c52ef R14: 00007fd333e1a300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 17839 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0xf lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc+0x277/0x370 mm/slab.c:3557 anon_vma_chain_alloc mm/rmap.c:129 [inline] __anon_vma_prepare+0x5d/0x560 mm/rmap.c:183 anon_vma_prepare include/linux/rmap.h:154 [inline] do_huge_pmd_anonymous_page+0x106e/0x1e60 mm/huge_memory.c:691 create_huge_pmd mm/memory.c:4066 [inline] __handle_mm_fault+0x289c/0x41c0 mm/memory.c:4270 handle_mm_fault+0x436/0xb10 mm/memory.c:4336 __do_page_fault+0x68e/0xd60 arch/x86/mm/fault.c:1412 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1205 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 0f 01 cb 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 01 ca c3 66 2e 0f 1f 84 00 00 00 00 00 0f 01 cb 83 RSP: 0018:ffff888045487c20 EFLAGS: 00050206 RAX: ffffed10165cb268 RBX: 0000000000000800 RCX: 0000000000000800 RDX: 0000000000000800 RSI: 00000000200000c0 RDI: ffff8880b2e58b40 RBP: 00000000200000c0 R08: 0000000000000001 R09: ffffed10165cb267 R10: ffff8880b2e5933f R11: 0000000000000000 R12: 00000000200008c0 R13: ffff8880b2e58b40 R14: 00007ffffffff000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:71 [inline] _copy_from_user+0xfc/0x130 lib/usercopy.c:13 copy_from_user include/linux/uaccess.h:147 [inline] do_tty_write drivers/tty/tty_io.c:958 [inline] tty_write+0x446/0x810 drivers/tty/tty_io.c:1044 __vfs_write+0xf7/0x770 fs/read_write.c:485 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fd3358a80c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd333e1a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fd3359c7f80 RCX: 00007fd3358a80c9 RDX: 000000000208e24b RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fd333e1a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff3a7c52ef R14: 00007fd333e1a300 R15: 0000000000022000 ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 netlink: 44 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 44 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 44 bytes leftover after parsing attributes in process `syz-executor.1'. ---------------- Code disassembly (best guess): 0: 89 d1 mov %edx,%ecx 2: c1 e9 03 shr $0x3,%ecx 5: 83 e2 07 and $0x7,%edx 8: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) b: 89 d1 mov %edx,%ecx d: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) f: 31 c0 xor %eax,%eax 11: 0f 01 ca clac 14: c3 retq 15: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 1c: 0f 01 cb stac 1f: 83 fa 40 cmp $0x40,%edx 22: 0f 82 70 ff ff ff jb 0xffffff98 28: 89 d1 mov %edx,%ecx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 retq 32: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 39: 00 00 00 3c: 0f 01 cb stac 3f: 83 .byte 0x83