RBP: 00007ff180f271d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffea0f51e5f R14: 00007ff180f27300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/28522 is trying to acquire lock: 00000000e287d55d (console_owner){-...}, at: console_trylock_spinning kernel/printk/printk.c:1697 [inline] 00000000e287d55d (console_owner){-...}, at: vprintk_emit+0x3fe/0x740 kernel/printk/printk.c:1964 but task is already holding lock: 000000003105c4a8 (&(&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 tty_send_xchar+0x28d/0x3b0 drivers/tty/tty_io.c:1093 n_tty_ioctl_helper+0x18d/0x3a0 drivers/tty/tty_ioctl.c:927 n_tty_ioctl+0x56/0x360 drivers/tty/n_tty.c:2464 tty_ioctl+0x65d/0x1630 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 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 *** 4 locks held by syz-executor.3/28522: #0: 0000000098ad05e8 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:272 #1: 000000008ec52c1d (&tty->atomic_write_lock){+.+.}, at: tty_write_lock drivers/tty/tty_io.c:886 [inline] #1: 000000008ec52c1d (&tty->atomic_write_lock){+.+.}, at: tty_send_xchar+0x1d9/0x3b0 drivers/tty/tty_io.c:1087 #2: 0000000000e41e4f (&tty->termios_rwsem){++++}, at: tty_send_xchar+0x226/0x3b0 drivers/tty/tty_io.c:1090 #3: 000000003105c4a8 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 drivers/tty/pty.c:120 stack backtrace: CPU: 1 PID: 28522 Comm: syz-executor.3 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 tty_send_xchar+0x28d/0x3b0 drivers/tty/tty_io.c:1093 n_tty_ioctl_helper+0x18d/0x3a0 drivers/tty/tty_ioctl.c:927 n_tty_ioctl+0x56/0x360 drivers/tty/n_tty.c:2464 tty_ioctl+0x65d/0x1630 drivers/tty/tty_io.c:2678 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7ff1829b50a9 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:00007ff180f27168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff182ad4f80 RCX: 00007ff1829b50a9 RDX: 0000000000000003 RSI: 000000000000540a RDI: 0000000000000003 RBP: 00007ff180f271d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffea0f51e5f R14: 00007ff180f27300 R15: 0000000000022000 vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3) CPU: 0 PID: 28531 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 vhci_hcd vhci_hcd.0: Device attached 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_trace+0x284/0x380 mm/slab.c:3623 kmalloc include/linux/slab.h:515 [inline] sock_alloc_inode+0x5f/0x250 net/socket.c:247 alloc_inode+0x5d/0x180 fs/inode.c:211 new_inode_pseudo+0x14/0xe0 fs/inode.c:911 sock_alloc+0x3c/0x260 net/socket.c:567 vhci_hcd: connection closed vhci_hcd: stop threads __sock_create+0xba/0x740 net/socket.c:1329 sock_create net/socket.c:1416 [inline] __sys_socketpair+0x242/0x570 net/socket.c:1520 vhci_hcd: release socket __do_sys_socketpair net/socket.c:1569 [inline] __se_sys_socketpair net/socket.c:1566 [inline] __x64_sys_socketpair+0x93/0xf0 net/socket.c:1566 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 vhci_hcd: disconnect device entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8eac0ce0a9 vhci_hcd vhci_hcd.0: pdev(1) rhport(0) sockfd(3) 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 vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) RSP: 002b:00007f8eaa640168 EFLAGS: 00000246 ORIG_RAX: 0000000000000035 vhci_hcd vhci_hcd.0: Device attached RAX: ffffffffffffffda RBX: 00007f8eac1edf80 RCX: 00007f8eac0ce0a9 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000018 RBP: 00007f8eaa6401d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fffda9d71ff R14: 00007f8eaa640300 R15: 0000000000022000 socket: no more sockets vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 28569 Comm: syz-executor.4 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] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x2ab/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1483 sk_alloc+0x36/0xec0 net/core/sock.c:1537 pptp_create+0x2d/0x300 drivers/net/ppp/pptp.c:550 pppox_create+0x10c/0x220 drivers/net/ppp/pppox.c:134 __sock_create+0x3d8/0x740 net/socket.c:1365 sock_create net/socket.c:1416 [inline] __sys_socketpair+0x242/0x570 net/socket.c:1520 __do_sys_socketpair net/socket.c:1569 [inline] __se_sys_socketpair net/socket.c:1566 [inline] __x64_sys_socketpair+0x93/0xf0 net/socket.c:1566 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8eac0ce0a9 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:00007f8eaa640168 EFLAGS: 00000246 ORIG_RAX: 0000000000000035 RAX: ffffffffffffffda RBX: 00007f8eac1edf80 RCX: 00007f8eac0ce0a9 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000018 RBP: 00007f8eaa6401d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fffda9d71ff R14: 00007f8eaa640300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 vhci_hcd vhci_hcd.0: pdev(1) rhport(0) sockfd(3) vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) CPU: 0 PID: 28583 Comm: syz-executor.4 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 vhci_hcd vhci_hcd.0: Device attached __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_trace+0x284/0x380 mm/slab.c:3623 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] apparmor_sk_alloc_security+0x5c/0xe0 security/apparmor/lsm.c:769 security_sk_alloc+0x50/0xb0 security/security.c:1469 sk_prot_alloc+0x200/0x2d0 net/core/sock.c:1486 sk_alloc+0x36/0xec0 net/core/sock.c:1537 pptp_create+0x2d/0x300 drivers/net/ppp/pptp.c:550 pppox_create+0x10c/0x220 drivers/net/ppp/pppox.c:134 __sock_create+0x3d8/0x740 net/socket.c:1365 sock_create net/socket.c:1416 [inline] __sys_socketpair+0x242/0x570 net/socket.c:1520 vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket __do_sys_socketpair net/socket.c:1569 [inline] __se_sys_socketpair net/socket.c:1566 [inline] __x64_sys_socketpair+0x93/0xf0 net/socket.c:1566 vhci_hcd: disconnect device do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8eac0ce0a9 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:00007f8eaa640168 EFLAGS: 00000246 ORIG_RAX: 0000000000000035 RAX: ffffffffffffffda RBX: 00007f8eac1edf80 RCX: 00007f8eac0ce0a9 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000018 RBP: 00007f8eaa6401d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fffda9d71ff R14: 00007f8eaa640300 R15: 0000000000022000 vhci_hcd vhci_hcd.0: pdev(3) rhport(0) sockfd(5) vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device vhci_hcd vhci_hcd.0: pdev(3) rhport(0) sockfd(5) vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd: disconnect device vhci_hcd vhci_hcd.0: pdev(3) rhport(0) sockfd(5) vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(5) vhci_hcd: disconnect device vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed) vhci_hcd vhci_hcd.0: Device attached vhci_hcd: connection closed vhci_hcd: stop threads vhci_hcd: release socket ---------------- Code disassembly (best guess): 0: 28 00 sub %al,(%rax) 2: 00 00 add %al,(%rax) 4: 75 05 jne 0xb 6: 48 83 c4 28 add $0x28,%rsp a: c3 retq b: e8 f1 19 00 00 callq 0x1a01 10: 90 nop 11: 48 89 f8 mov %rdi,%rax 14: 48 89 f7 mov %rsi,%rdi 17: 48 89 d6 mov %rdx,%rsi 1a: 48 89 ca mov %rcx,%rdx 1d: 4d 89 c2 mov %r8,%r10 20: 4d 89 c8 mov %r9,%r8 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 28: 0f 05 syscall * 2a: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 01 jae 0x33 32: c3 retq 33: 48 c7 c1 b8 ff ff ff mov $0xffffffffffffffb8,%rcx 3a: f7 d8 neg %eax 3c: 64 89 01 mov %eax,%fs:(%rcx) 3f: 48 rex.W