FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 ====================================================== WARNING: possible circular locking dependency detected 5.15.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/19563 is trying to acquire lock: ffffffff8b892a40 (console_owner){-.-.}-{0:0}, at: console_unlock+0x303/0xb70 kernel/printk/printk.c:2707 but task is already holding lock: ffff88801fef5958 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 drivers/tty/pty.c:120 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 include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 tty_port_tty_get+0x1f/0x100 drivers/tty/tty_port.c:289 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:48 serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1845 __start_tx drivers/tty/serial/8250/8250_port.c:1575 [inline] serial8250_start_tx+0x63a/0x9b0 drivers/tty/serial/8250/8250_port.c:1667 __uart_start.isra.0+0x162/0x1b0 drivers/tty/serial/serial_core.c:127 uart_write+0x2fb/0x570 drivers/tty/serial/serial_core.c:590 process_output_block drivers/tty/n_tty.c:592 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2288 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1110 redirected_tty_write+0xa1/0xc0 drivers/tty/tty_io.c:1131 call_write_iter include/linux/fs.h:2161 [inline] new_sync_write+0x429/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 serial8250_console_write+0x91a/0xb70 drivers/tty/serial/8250/8250_port.c:3345 call_console_drivers kernel/printk/printk.c:1929 [inline] console_unlock+0x7a9/0xb70 kernel/printk/printk.c:2711 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2245 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2266 register_console kernel/printk/printk.c:3051 [inline] register_console+0x55f/0x780 kernel/printk/printk.c:2931 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:680 console_init+0x3c1/0x58d kernel/printk/printk.c:3151 start_kernel+0x30b/0x49b init/main.c:1062 secondary_startup_64_no_verify+0xb0/0xbb -> #0 (console_owner){-.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 console_lock_spinning_enable kernel/printk/printk.c:1781 [inline] console_unlock+0x356/0xb70 kernel/printk/printk.c:2708 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2245 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2266 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1328 slab_pre_alloc_hook mm/slab.h:494 [inline] slab_alloc_node mm/slub.c:3127 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x72/0x320 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:177 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:275 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:42 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3174 __process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:725 process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:808 n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1802 tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365 set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438 set_termios drivers/tty/tty_ioctl.c:392 [inline] tty_mode_ioctl+0x9f1/0xe70 drivers/tty/tty_ioctl.c:756 n_tty_ioctl_helper+0x53/0x2d0 drivers/tty/tty_ioctl.c:907 n_tty_ioctl+0x56/0x370 drivers/tty/n_tty.c:2421 tty_ioctl+0xc69/0x1670 drivers/tty/tty_io.c:2814 tty_compat_ioctl+0x295/0x410 drivers/tty/tty_io.c:2955 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c 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.3/19563: #0: ffff8880237d1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:252 #1: ffff8880237d12e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: tty_set_termios+0xfe/0x910 drivers/tty/tty_ioctl.c:352 #2: ffff8880237d1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 #3: ffffc90020653378 (&ldata->output_lock){+.+.}-{3:3}, at: process_echoes+0xaf/0x1c0 drivers/tty/n_tty.c:806 #4: ffff88801fef5958 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 drivers/tty/pty.c:120 #5: ffffffff8b972e80 (console_lock){+.+.}-{0:0}, at: vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 stack backtrace: CPU: 2 PID: 19563 Comm: syz-executor.3 Not tainted 5.15.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2131 check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 console_lock_spinning_enable kernel/printk/printk.c:1781 [inline] console_unlock+0x356/0xb70 kernel/printk/printk.c:2708 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2245 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2266 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1328 slab_pre_alloc_hook mm/slab.h:494 [inline] slab_alloc_node mm/slub.c:3127 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x72/0x320 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:177 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:275 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:42 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3174 __process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:725 process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:808 n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1802 tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365 set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438 set_termios drivers/tty/tty_ioctl.c:392 [inline] tty_mode_ioctl+0x9f1/0xe70 drivers/tty/tty_ioctl.c:756 n_tty_ioctl_helper+0x53/0x2d0 drivers/tty/tty_ioctl.c:907 n_tty_ioctl+0x56/0x370 drivers/tty/n_tty.c:2421 tty_ioctl+0xc69/0x1670 drivers/tty/tty_io.c:2814 tty_compat_ioctl+0x295/0x410 drivers/tty/tty_io.c:2955 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6e6b549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f44655fc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000005408 RDX: 0000000020000100 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 CPU: 2 PID: 19563 Comm: syz-executor.3 Not tainted 5.15.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1328 slab_pre_alloc_hook mm/slab.h:494 [inline] slab_alloc_node mm/slub.c:3127 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x72/0x320 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:177 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:275 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:42 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3174 __process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:725 process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:808 n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1802 tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365 set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438 set_termios drivers/tty/tty_ioctl.c:392 [inline] tty_mode_ioctl+0x9f1/0xe70 drivers/tty/tty_ioctl.c:756 n_tty_ioctl_helper+0x53/0x2d0 drivers/tty/tty_ioctl.c:907 n_tty_ioctl+0x56/0x370 drivers/tty/n_tty.c:2421 tty_ioctl+0xc69/0x1670 drivers/tty/tty_io.c:2814 tty_compat_ioctl+0x295/0x410 drivers/tty/tty_io.c:2955 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6e6b549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f44655fc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000005408 RDX: 0000000020000100 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: 03 74 c0 01 add 0x1(%rax,%rax,8),%esi 4: 10 05 03 74 b8 01 adc %al,0x1b87403(%rip) # 0x1b8740d a: 10 06 adc %al,(%rsi) c: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 10: 10 07 adc %al,(%rdi) 12: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi 16: 10 08 adc %cl,(%rax) 18: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1c: 00 00 add %al,(%rax) 1e: 00 00 add %al,(%rax) 20: 00 51 52 add %dl,0x52(%rcx) 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 retq 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 39: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi