FAULT_INJECTION: forcing a failure. name fail_page_alloc, interval 1, probability 0, space 0, times 0 ttyprintk ttyprintk: tty_port_close_start: tty->count = 1 port count = 2 ====================================================== WARNING: possible circular locking dependency detected 4.19.150-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/12708 is trying to acquire lock: 0000000065bfd011 (console_owner){-...}, at: console_trylock_spinning kernel/printk/printk.c:1697 [inline] 0000000065bfd011 (console_owner){-...}, at: vprintk_emit+0x40a/0x7c0 kernel/printk/printk.c:1964 but task is already holding lock: 00000000cbb87c69 (&(&port->lock)->rlock){-.-.}, at: tty_port_close_start.part.0+0x28/0x540 drivers/tty/tty_port.c:574 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:1806 serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1893 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1866 [inline] serial8250_default_handle_irq+0xae/0x220 drivers/tty/serial/8250/8250_port.c:1909 serial8250_interrupt+0xf2/0x1d0 drivers/tty/serial/8250/8250_core.c:125 __handle_irq_event_percpu+0x27e/0x990 kernel/irq/handle.c:149 handle_irq_event_percpu+0x76/0x170 kernel/irq/handle.c:189 handle_irq_event+0xa1/0x12c kernel/irq/handle.c:206 handle_edge_irq+0x261/0xcf0 kernel/irq/chip.c:797 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline] handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0xac/0x230 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+0xa7/0xf0 kernel/locking/spinlock.c:184 spin_unlock_irqrestore include/linux/spinlock.h:384 [inline] uart_write+0x391/0x680 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/0x890 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/0x670 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&port_lock_key){-.-.}: serial8250_console_write+0x89b/0xb00 drivers/tty/serial/8250/8250_port.c:3270 call_console_drivers kernel/printk/printk.c:1764 [inline] console_unlock+0xb14/0x1080 kernel/printk/printk.c:2460 vprintk_emit+0x2b8/0x7c0 kernel/printk/printk.c:1965 vprintk_func+0x77/0x224 kernel/printk/printk_safe.c:397 printk+0xba/0xed kernel/printk/printk.c:2040 register_console+0x76e/0xdd0 kernel/printk/printk.c:2776 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:684 console_init+0x529/0x7a5 kernel/printk/printk.c:2862 start_kernel+0x6ed/0x978 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+0x447/0x7c0 kernel/printk/printk.c:1964 vprintk_func+0x77/0x224 kernel/printk/printk_safe.c:397 printk+0xba/0xed kernel/printk/printk.c:2040 tty_port_close_start.part.0+0x4f3/0x540 drivers/tty/tty_port.c:576 tty_port_close_start drivers/tty/tty_port.c:648 [inline] tty_port_close+0x46/0x160 drivers/tty/tty_port.c:641 tty_release+0x455/0x1190 drivers/tty/tty_io.c:1678 __fput+0x2ce/0x8a0 fs/file_table.c:278 task_work_run+0x141/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x269/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x57c/0x670 arch/x86/entry/common.c:296 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 *** 2 locks held by syz-executor.5/12708: #0: 000000004e39d16d (&tty->legacy_mutex){+.+.}, at: tty_lock+0x6a/0xa0 drivers/tty/tty_mutex.c:19 #1: 00000000cbb87c69 (&(&port->lock)->rlock){-.-.}, at: tty_port_close_start.part.0+0x28/0x540 drivers/tty/tty_port.c:574 stack backtrace: CPU: 1 PID: 12708 Comm: syz-executor.5 Not tainted 4.19.150-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x22c/0x33e lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1865 [inline] check_prevs_add kernel/locking/lockdep.c:1978 [inline] validate_chain kernel/locking/lockdep.c:2419 [inline] __lock_acquire+0x37ad/0x3ff0 kernel/locking/lockdep.c:3415 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3907 console_trylock_spinning kernel/printk/printk.c:1718 [inline] vprintk_emit+0x447/0x7c0 kernel/printk/printk.c:1964 vprintk_func+0x77/0x224 kernel/printk/printk_safe.c:397 printk+0xba/0xed kernel/printk/printk.c:2040 tty_port_close_start.part.0+0x4f3/0x540 drivers/tty/tty_port.c:576 tty_port_close_start drivers/tty/tty_port.c:648 [inline] tty_port_close+0x46/0x160 drivers/tty/tty_port.c:641 tty_release+0x455/0x1190 drivers/tty/tty_io.c:1678 __fput+0x2ce/0x8a0 fs/file_table.c:278 task_work_run+0x141/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x269/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x57c/0x670 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x417781 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 1a 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffdb7fe8540 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000417781 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000001190108 R09: 0000000000000000 R10: 00007ffdb7fe8610 R11: 0000000000000293 R12: ffffffffffffffff R13: 0000000000000000 R14: 0000000000000002 R15: 000000000118bf2c CPU: 0 PID: 12713 Comm: syz-executor.1 Not tainted 4.19.150-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x22c/0x33e lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0x2f lib/fault-inject.c:149 should_fail_alloc_page mm/page_alloc.c:3087 [inline] prepare_alloc_pages mm/page_alloc.c:4345 [inline] __alloc_pages_nodemask+0x256/0x2a60 mm/page_alloc.c:4392 alloc_pages_current+0x19d/0x2c0 mm/mempolicy.c:2197 alloc_pages include/linux/gfp.h:532 [inline] pte_alloc_one+0x16/0x1b0 arch/x86/mm/pgtable.c:35 __do_huge_pmd_anonymous_page mm/huge_memory.c:574 [inline] do_huge_pmd_anonymous_page+0xb86/0x1d70 mm/huge_memory.c:738 create_huge_pmd mm/memory.c:4025 [inline] __handle_mm_fault+0x2905/0x4370 mm/memory.c:4229 handle_mm_fault+0x489/0xb90 mm/memory.c:4295 __do_page_fault+0x6d8/0xe00 arch/x86/mm/fault.c:1412 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1205 RIP: 0010:__put_user_4+0x1c/0x30 arch/x86/lib/putuser.S:70 Code: 1f 00 c3 90 66 2e 0f 1f 84 00 00 00 00 00 65 48 8b 1c 25 40 ee 01 00 48 8b 9b 18 14 00 00 48 83 eb 03 48 39 d9 73 3c 0f 1f 00 <89> 01 31 c0 0f 1f 00 c3 66 90 66 2e 0f 1f 84 00 00 00 00 00 65 48 RSP: 0018:ffff888092b9fe28 EFLAGS: 00010297 RAX: 0000000000000004 RBX: 00007fffffffeffd RCX: 00000000200002c0 RDX: 000000000000005c RSI: ffffffff8611bbab RDI: 0000000000000286 RBP: 0000000000000002 R08: 00000000a09d3ee8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004 R13: 0000000000000005 R14: 0000000000000000 R15: dffffc0000000000 __sys_socketpair+0x107/0x570 net/socket.c:1391 __do_sys_socketpair net/socket.c:1457 [inline] __se_sys_socketpair net/socket.c:1454 [inline] __x64_sys_socketpair+0x93/0xf0 net/socket.c:1454 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45de29 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f255ab02c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000035 RAX: ffffffffffffffda RBX: 0000000000034fc0 RCX: 000000000045de29 RDX: 0000000000000001 RSI: 0000000000000002 RDI: 0000000000000022 RBP: 00007f255ab02ca0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000200002c0 R11: 0000000000000246 R12: 0000000000000003 R13: 00007fffab884c3f R14: 00007f255ab039c0 R15: 000000000118bf2c delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack delete_channel: no stack can: request_module (can-proto-0) failed. can: request_module (can-proto-0) failed. 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