RBP: 00007fdc29bb41d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000200 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffea40cce3f R14: 00007fdc29bb4300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 5.10.230 #1 Not tainted ------------------------------------------------------ syz-executor.4/5868 is trying to acquire lock: ffffffff84f0dbe0 (console_owner){-.-.}-{0:0}, at: console_unlock+0x2e1/0xb40 kernel/printk/printk.c:2513 but task is already holding lock: ffff88801cee3158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x2b/0x160 drivers/tty/tty_buffer.c:575 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+0x36/0x60 kernel/locking/spinlock.c:159 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+0x51f/0xb00 drivers/tty/serial/8250/8250_port.c:1826 __start_tx drivers/tty/serial/8250/8250_port.c:1545 [inline] serial8250_start_tx+0x695/0xa60 drivers/tty/serial/8250/8250_port.c:1650 __uart_start.isra.0+0x17c/0x1c0 drivers/tty/serial/serial_core.c:132 uart_write+0x2f2/0x580 drivers/tty/serial/serial_core.c:615 do_output_char+0x5e8/0x870 drivers/tty/n_tty.c:443 process_output drivers/tty/n_tty.c:510 [inline] n_tty_write+0x4c9/0xfe0 drivers/tty/n_tty.c:2396 do_tty_write drivers/tty/tty_io.c:1029 [inline] file_tty_write.constprop.0+0x529/0x910 drivers/tty/tty_io.c:1119 redirected_tty_write+0xa5/0xd0 drivers/tty/tty_io.c:1126 call_write_iter include/linux/fs.h:2039 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x191/0x700 fs/read_write.c:866 vfs_writev+0x1ae/0x620 fs/read_write.c:939 do_writev+0x139/0x300 fs/read_write.c:982 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 kernel/locking/spinlock.c:159 serial8250_console_write+0x9f5/0xc60 drivers/tty/serial/8250/8250_port.c:3325 call_console_drivers kernel/printk/printk.c:1917 [inline] console_unlock+0x82a/0xb40 kernel/printk/printk.c:2538 register_console kernel/printk/printk.c:2902 [inline] register_console+0x40c/0x850 kernel/printk/printk.c:2802 univ8250_console_init+0x3a/0x4a drivers/tty/serial/8250/8250_core.c:700 console_init+0x24c/0x356 kernel/printk/printk.c:3012 start_kernel+0x2e6/0x489 init/main.c:981 secondary_startup_64_no_verify+0xbe/0xcb -> #0 (console_owner){-.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:2988 [inline] check_prevs_add kernel/locking/lockdep.c:3113 [inline] validate_chain kernel/locking/lockdep.c:3729 [inline] __lock_acquire+0x29e7/0x5b00 kernel/locking/lockdep.c:4955 lock_acquire kernel/locking/lockdep.c:5566 [inline] lock_acquire+0x197/0x470 kernel/locking/lockdep.c:5531 console_lock_spinning_enable kernel/printk/printk.c:1763 [inline] console_unlock+0x360/0xb40 kernel/printk/printk.c:2535 vprintk_emit+0x1de/0x4e0 kernel/printk/printk.c:2060 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xf1 kernel/printk/printk.c:2108 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x47a/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1200 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] __kmalloc+0x72/0x390 mm/slub.c:3967 kmalloc include/linux/slab.h:557 [inline] tty_buffer_alloc+0x243/0x2b0 drivers/tty/tty_buffer.c:175 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:274 tty_insert_flip_string_fixed_flag+0x91/0x250 drivers/tty/tty_buffer.c:319 tty_insert_flip_string include/linux/tty_flip.h:36 [inline] tty_insert_flip_string_and_push_buffer+0x3e/0x160 drivers/tty/tty_buffer.c:576 pty_write+0xe6/0x110 drivers/tty/pty.c:119 n_tty_write+0xa86/0xfe0 drivers/tty/n_tty.c:2407 do_tty_write drivers/tty/tty_io.c:1029 [inline] file_tty_write.constprop.0+0x529/0x910 drivers/tty/tty_io.c:1119 call_write_iter include/linux/fs.h:2039 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x191/0x700 fs/read_write.c:866 vfs_iter_write+0x70/0xa0 fs/read_write.c:907 iter_file_splice_write+0x726/0xc90 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x10f/0x170 fs/splice.c:936 splice_direct_to_actor+0x387/0x980 fs/splice.c:891 do_splice_direct+0x1c4/0x290 fs/splice.c:979 do_sendfile+0x553/0x11e0 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1d1/0x210 fs/read_write.c:1304 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 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.4/5868: #0: ffff88800f99f098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x90 drivers/tty/tty_ldisc.c:267 #1: ffff88800f99f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:953 [inline] #1: ffff88800f99f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:976 [inline] #1: ffff88800f99f130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x29f/0x910 drivers/tty/tty_io.c:1119 #2: ffff88800f99f2e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1bf/0xfe0 drivers/tty/n_tty.c:2367 #3: ffffc90000745378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0xa4d/0xfe0 drivers/tty/n_tty.c:2406 #4: ffff88801cee3158 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x2b/0x160 drivers/tty/tty_buffer.c:575 #5: ffffffff84fedf60 (console_lock){+.+.}-{0:0}, at: vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 stack backtrace: CPU: 1 PID: 5868 Comm: syz-executor.4 Not tainted 5.10.230 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 lib/dump_stack.c:118 check_noncircular+0x263/0x2e0 kernel/locking/lockdep.c:2123 check_prev_add kernel/locking/lockdep.c:2988 [inline] check_prevs_add kernel/locking/lockdep.c:3113 [inline] validate_chain kernel/locking/lockdep.c:3729 [inline] __lock_acquire+0x29e7/0x5b00 kernel/locking/lockdep.c:4955 lock_acquire kernel/locking/lockdep.c:5566 [inline] lock_acquire+0x197/0x470 kernel/locking/lockdep.c:5531 console_lock_spinning_enable kernel/printk/printk.c:1763 [inline] console_unlock+0x360/0xb40 kernel/printk/printk.c:2535 vprintk_emit+0x1de/0x4e0 kernel/printk/printk.c:2060 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xf1 kernel/printk/printk.c:2108 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x47a/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1200 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] __kmalloc+0x72/0x390 mm/slub.c:3967 kmalloc include/linux/slab.h:557 [inline] tty_buffer_alloc+0x243/0x2b0 drivers/tty/tty_buffer.c:175 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:274 tty_insert_flip_string_fixed_flag+0x91/0x250 drivers/tty/tty_buffer.c:319 tty_insert_flip_string include/linux/tty_flip.h:36 [inline] tty_insert_flip_string_and_push_buffer+0x3e/0x160 drivers/tty/tty_buffer.c:576 pty_write+0xe6/0x110 drivers/tty/pty.c:119 n_tty_write+0xa86/0xfe0 drivers/tty/n_tty.c:2407 do_tty_write drivers/tty/tty_io.c:1029 [inline] file_tty_write.constprop.0+0x529/0x910 drivers/tty/tty_io.c:1119 call_write_iter include/linux/fs.h:2039 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x191/0x700 fs/read_write.c:866 vfs_iter_write+0x70/0xa0 fs/read_write.c:907 iter_file_splice_write+0x726/0xc90 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x10f/0x170 fs/splice.c:936 splice_direct_to_actor+0x387/0x980 fs/splice.c:891 do_splice_direct+0x1c4/0x290 fs/splice.c:979 do_sendfile+0x553/0x11e0 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1d1/0x210 fs/read_write.c:1304 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 RIP: 0033:0x7fdc2c63eb19 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:00007fdc29bb4188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fdc2c751f60 RCX: 00007fdc2c63eb19 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 00007fdc29bb41d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000200 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffea40cce3f R14: 00007fdc29bb4300 R15: 0000000000022000 EXT4-fs (loop5): VFS: Can't find ext4 filesystem FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop2): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop6): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop2): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop2): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1)