FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 ====================================================== WARNING: possible circular locking dependency detected 5.17.0-rc2-next-20220204 #1 Not tainted ------------------------------------------------------ syz-executor.6/21127 is trying to acquire lock: ffffffff85114b60 (console_owner){-.-.}-{0:0}, at: console_unlock+0x2f4/0xae0 but task is already holding lock: ffff8880414b5158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&port->lock){-.-.}-{2:2}: _raw_spin_lock_irqsave+0x39/0x50 tty_port_tty_get+0x1f/0x100 tty_port_default_wakeup+0x11/0x40 serial8250_tx_chars+0x50b/0xb00 serial8250_handle_irq.part.0+0x3f1/0x4c0 serial8250_default_handle_irq+0xb8/0x230 serial8250_interrupt+0xf4/0x1a0 __handle_irq_event_percpu+0x20f/0x820 handle_irq_event+0xa7/0x1e0 handle_edge_irq+0x262/0xd10 __common_interrupt+0x92/0x1d0 common_interrupt+0x9f/0xc0 asm_common_interrupt+0x1e/0x40 default_idle+0xb/0x10 default_idle_call+0x87/0xd0 do_idle+0x3b9/0x530 cpu_startup_entry+0x14/0x20 secondary_startup_64_no_verify+0xd5/0xdb -> #1 (&port_lock_key){-.-.}-{2:2}: _raw_spin_lock_irqsave+0x39/0x50 serial8250_console_write+0x90e/0xb20 console_unlock+0x756/0xae0 register_console+0x378/0x7d0 univ8250_console_init+0x3a/0x46 console_init+0x3c1/0x58d start_kernel+0x301/0x4a5 secondary_startup_64_no_verify+0xd5/0xdb -> #0 (console_owner){-.-.}-{0:0}: __lock_acquire+0x2c2f/0x6120 lock_acquire+0x1a2/0x4d0 console_unlock+0x347/0xae0 vprintk_emit+0x198/0x450 vprintk+0x80/0x90 _printk+0xba/0xed should_fail+0x472/0x5a0 should_failslab+0x5/0x10 __kmalloc+0x72/0x440 tty_buffer_alloc+0x23f/0x2a0 __tty_buffer_request_room+0x156/0x2a0 tty_insert_flip_string_fixed_flag+0x91/0x240 pty_write+0x11c/0x1e0 n_tty_write+0xa86/0xfe0 file_tty_write.constprop.0+0x529/0x910 new_sync_write+0x437/0x660 vfs_write+0x7d1/0xae0 ksys_write+0x12d/0x250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &port->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port->lock); lock(&port_lock_key); lock(&port->lock); lock(console_owner); *** DEADLOCK *** 6 locks held by syz-executor.6/21127: #0: ffff888017fa6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 #1: ffff888017fa6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x29f/0x910 #2: ffff888017fa62e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1bf/0xfe0 #3: ffffc9001415c378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0xa4d/0xfe0 #4: ffff8880414b5158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 #5: ffffffff851f4fa0 (console_lock){+.+.}-{0:0}, at: vprintk+0x80/0x90 stack backtrace: CPU: 0 PID: 21127 Comm: syz-executor.6 Not tainted 5.17.0-rc2-next-20220204 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 check_noncircular+0x25f/0x2e0 __lock_acquire+0x2c2f/0x6120 lock_acquire+0x1a2/0x4d0 console_unlock+0x347/0xae0 vprintk_emit+0x198/0x450 vprintk+0x80/0x90 _printk+0xba/0xed should_fail+0x472/0x5a0 should_failslab+0x5/0x10 __kmalloc+0x72/0x440 tty_buffer_alloc+0x23f/0x2a0 __tty_buffer_request_room+0x156/0x2a0 tty_insert_flip_string_fixed_flag+0x91/0x240 pty_write+0x11c/0x1e0 n_tty_write+0xa86/0xfe0 file_tty_write.constprop.0+0x529/0x910 new_sync_write+0x437/0x660 vfs_write+0x7d1/0xae0 ksys_write+0x12d/0x250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f494ace8b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f494825e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f494adfbf60 RCX: 00007f494ace8b19 RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000004 RBP: 00007f494825e1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc1c12edef R14: 00007f494825e300 R15: 0000000000022000 CPU: 0 PID: 21127 Comm: syz-executor.6 Not tainted 5.17.0-rc2-next-20220204 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 should_fail.cold+0x5/0xa should_failslab+0x5/0x10 __kmalloc+0x72/0x440 tty_buffer_alloc+0x23f/0x2a0 __tty_buffer_request_room+0x156/0x2a0 tty_insert_flip_string_fixed_flag+0x91/0x240 pty_write+0x11c/0x1e0 n_tty_write+0xa86/0xfe0 file_tty_write.constprop.0+0x529/0x910 new_sync_write+0x437/0x660 vfs_write+0x7d1/0xae0 ksys_write+0x12d/0x250 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f494ace8b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f494825e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f494adfbf60 RCX: 00007f494ace8b19 RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000004 RBP: 00007f494825e1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc1c12edef R14: 00007f494825e300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 21130 Comm: syz-executor.7 Not tainted 5.17.0-rc2-next-20220204 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 should_fail.cold+0x5/0xa should_failslab+0x5/0x10 kmem_cache_alloc+0x5b/0x480 __alloc_file+0x21/0x240 alloc_empty_file+0x6d/0x170 path_openat+0xe1/0x28a0 do_filp_open+0x1aa/0x400 do_sys_openat2+0x16d/0x4d0 __x64_sys_openat+0x13f/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7a9d388b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7a9a8fe188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f7a9d49bf60 RCX: 00007f7a9d388b19 RDX: 0000000000101042 RSI: 0000000020000100 RDI: ffffffffffffff9c RBP: 00007f7a9a8fe1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff419bfe1f R14: 00007f7a9a8fe300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name fail_usercopy, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 21133 Comm: syz-executor.5 Not tainted 5.17.0-rc2-next-20220204 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 should_fail.cold+0x5/0xa strncpy_from_user+0x34/0x3e0 getname_flags.part.0+0x95/0x4f0 getname+0x8e/0xd0 do_sys_openat2+0xf5/0x4d0 __x64_sys_openat+0x13f/0x1f0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd919e25b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd91739b188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fd919f38f60 RCX: 00007fd919e25b19 RDX: 0000000000101042 RSI: 0000000020000100 RDI: ffffffffffffff9c RBP: 00007fd91739b1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffed9621d4f R14: 00007fd91739b300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 21140 Comm: syz-executor.1 Not tainted 5.17.0-rc2-next-20220204 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 should_fail.cold+0x5/0xa should_failslab+0x5/0x10 kmem_cache_alloc_trace+0x55/0x3c0 alloc_workqueue_attrs+0x38/0x80 alloc_workqueue+0x939/0xeb0 loop_configure+0x6ec/0x1950 lo_ioctl+0x7c5/0x18b0 blkdev_ioctl+0x362/0x7f0 __x64_sys_ioctl+0x196/0x210 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f14bbac98d7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 a4 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f14b903ef48 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f14bbb13970 RCX: 00007f14bbac98d7 RDX: 0000000000000004 RSI: 0000000000004c00 RDI: 0000000000000005 RBP: 0000000000000005 R08: 0000000000000000 R09: ffffffffffffffff R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000004 R14: 00000000200002c8 R15: 0000000000000003