block nbd1: Attempted send on invalid socket ttyprintk ttyprintk: tty_port_close_start: tty->count = 1 port count = 2 print_req_error: I/O error, dev nbd1, sector 64 block nbd1: Attempted send on invalid socket ====================================================== WARNING: possible circular locking dependency detected 4.14.197-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/15684 is trying to acquire lock: (console_owner){-.-.}, at: [] console_trylock_spinning kernel/printk/printk.c:1658 [inline] (console_owner){-.-.}, at: [] vprintk_emit+0x32a/0x620 kernel/printk/printk.c:1922 but task is already holding lock: (&(&port->lock)->rlock){-.-.}, at: [] tty_port_close_start.part.0+0x28/0x4c0 drivers/tty/tty_port.c:573 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&port->lock)->rlock){-.-.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160 tty_port_tty_get+0x1d/0x80 drivers/tty/tty_port.c:288 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:46 serial8250_tx_chars+0x3fe/0xbf0 drivers/tty/serial/8250/8250_port.c:1810 serial8250_handle_irq.part.0+0x1f8/0x240 drivers/tty/serial/8250/8250_port.c:1883 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1869 [inline] serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1899 serial8250_interrupt+0xe4/0x1a0 drivers/tty/serial/8250/8250_core.c:129 __handle_irq_event_percpu+0xee/0x7f0 kernel/irq/handle.c:147 handle_irq_event_percpu kernel/irq/handle.c:187 [inline] handle_irq_event+0xf0/0x246 kernel/irq/handle.c:204 handle_edge_irq+0x224/0xc40 kernel/irq/chip.c:770 generic_handle_irq_desc include/linux/irqdesc.h:159 [inline] handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0x93/0x1d0 arch/x86/kernel/irq.c:230 ret_from_intr+0x0/0x1e native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline] default_idle+0x47/0x370 arch/x86/kernel/process.c:558 cpuidle_idle_call kernel/sched/idle.c:156 [inline] do_idle+0x250/0x3c0 kernel/sched/idle.c:246 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:351 start_kernel+0x750/0x770 init/main.c:708 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #1 (&port_lock_key){-.-.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160 serial8250_console_write+0x7a7/0x9d0 drivers/tty/serial/8250/8250_port.c:3239 call_console_drivers kernel/printk/printk.c:1725 [inline] console_unlock+0x99d/0xf20 kernel/printk/printk.c:2397 vprintk_emit+0x224/0x620 kernel/printk/printk.c:1923 vprintk_func+0x58/0x152 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 register_console+0x6f4/0xad0 kernel/printk/printk.c:2716 univ8250_console_init+0x2f/0x3a drivers/tty/serial/8250/8250_core.c:691 console_init+0x46/0x53 kernel/printk/printk.c:2797 start_kernel+0x52e/0x770 init/main.c:634 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (console_owner){-.-.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1922 vprintk_func+0x58/0x152 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 tty_port_close_start.part.0+0x46c/0x4c0 drivers/tty/tty_port.c:575 tty_port_close_start drivers/tty/tty_port.c:647 [inline] tty_port_close+0x3b/0x130 drivers/tty/tty_port.c:640 tty_release+0x402/0xe20 drivers/tty/tty_io.c:1670 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb 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 *** 2 locks held by syz-executor.0/15684: #0: (&tty->legacy_mutex){+.+.}, at: [] tty_lock+0x5f/0x70 drivers/tty/tty_mutex.c:19 #1: (&(&port->lock)->rlock){-.-.}, at: [] tty_port_close_start.part.0+0x28/0x4c0 drivers/tty/tty_port.c:573 stack backtrace: CPU: 1 PID: 15684 Comm: syz-executor.0 Not tainted 4.14.197-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x283 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1922 vprintk_func+0x58/0x152 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 tty_port_close_start.part.0+0x46c/0x4c0 drivers/tty/tty_port.c:575 tty_port_close_start drivers/tty/tty_port.c:647 [inline] tty_port_close+0x3b/0x130 drivers/tty/tty_port.c:640 tty_release+0x402/0xe20 drivers/tty/tty_io.c:1670 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x416f01 RSP: 002b:00007ffc4ed694e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000416f01 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000001190120 R09: 0000000000000000 R10: 00007ffc4ed695c0 R11: 0000000000000293 R12: 0000000001190128 R13: 0000000000000000 R14: ffffffffffffffff R15: 000000000118cf4c misc userio: No port type given on /dev/userio print_req_error: I/O error, dev nbd1, sector 256 ISOFS: Unable to identify CD-ROM format. UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=256, location=256 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 512 misc userio: No port type given on /dev/userio UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=512, location=512 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 64 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 512 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=256, location=256 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 1024 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=512, location=512 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 64 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 1024 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=256, location=256 ISOFS: Unable to identify CD-ROM format. block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 2048 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=512, location=512 block nbd1: Attempted send on invalid socket print_req_error: I/O error, dev nbd1, sector 64 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device nbd1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: warning (device nbd1): udf_fill_super: No partition found (1) misc userio: No port type given on /dev/userio 8021q: adding VLAN 0 to HW filter on device ipvlan2 8021q: adding VLAN 0 to HW filter on device ipvlan3 8021q: adding VLAN 0 to HW filter on device ipvlan4 8021q: adding VLAN 0 to HW filter on device ipvlan5 audit: type=1804 audit(1599814571.665:42): pid=15826 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir721396170/syzkaller.pyFqvv/398/bus" dev="sda1" ino=16748 res=1 8021q: adding VLAN 0 to HW filter on device ipvlan6 8021q: adding VLAN 0 to HW filter on device ipvlan7 8021q: adding VLAN 0 to HW filter on device ipvlan8 8021q: adding VLAN 0 to HW filter on device ipvlan9 netlink: 40 bytes leftover after parsing attributes in process `syz-executor.4'. 8021q: adding VLAN 0 to HW filter on device ipvlan10 8021q: adding VLAN 0 to HW filter on device ipvlan11 caif:caif_disconnect_client(): nothing to disconnect 8021q: adding VLAN 0 to HW filter on device ipvlan12 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect 8021q: adding VLAN 0 to HW filter on device ipvlan13 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect 8021q: adding VLAN 0 to HW filter on device ipvlan14 8021q: adding VLAN 0 to HW filter on device ipvlan15 hfs: unable to change iocharset hfs: unable to parse mount options ntfs: (device loop4): parse_options(): Unrecognized mount option . 8021q: adding VLAN 0 to HW filter on device ipvlan16 hfs: unable to change iocharset print_req_error: 2 callbacks suppressed print_req_error: I/O error, dev loop4, sector 0 hfs: unable to parse mount options ntfs: (device loop4): parse_options(): Unrecognized mount option . audit: type=1800 audit(1599814576.664:43): pid=16517 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=16807 res=0 audit: type=1800 audit(1599814576.694:44): pid=16517 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="sda1" ino=16807 res=0 block nbd2: shutting down sockets block nbd2: shutting down sockets