RBP: 00007fcf7a9901d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf360c15f R14: 00007fcf7a990300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 5.10.214 #1 Not tainted ------------------------------------------------------ syz-executor.0/6881 is trying to acquire lock: ffffffff84f0cdc0 (console_owner){-.-.}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:1833 [inline] ffffffff84f0cdc0 (console_owner){-.-.}-{0:0}, at: vprintk_emit+0x2ca/0x4d0 kernel/printk/printk.c:2053 but task is already holding lock: ffff88801b1e4958 (&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:1832 serial8250_handle_irq+0x4e4/0x660 drivers/tty/serial/8250/8250_port.c:1928 serial8250_default_handle_irq+0x96/0x210 drivers/tty/serial/8250/8250_port.c:1944 serial8250_interrupt+0xf4/0x1b0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x2ef/0x6d0 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0xff/0x280 kernel/irq/handle.c:213 handle_edge_irq+0x249/0xd00 kernel/irq/chip.c:822 asm_call_irq_on_stack+0x12/0x20 __run_irq_on_irqstack arch/x86/include/asm/irq_stack.h:48 [inline] run_irq_on_irqstack_cond arch/x86/include/asm/irq_stack.h:101 [inline] handle_irq arch/x86/kernel/irq.c:230 [inline] __common_interrupt arch/x86/kernel/irq.c:249 [inline] common_interrupt+0xdd/0x1a0 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:626 native_safe_halt arch/x86/include/asm/irqflags.h:60 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:103 [inline] default_idle+0xe/0x20 arch/x86/kernel/process.c:706 default_idle_call+0xbf/0x2c0 kernel/sched/idle.c:112 cpuidle_idle_call kernel/sched/idle.c:194 [inline] do_idle+0x3ad/0x520 kernel/sched/idle.c:300 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396 secondary_startup_64_no_verify+0xc2/0xcb -> #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:3331 call_console_drivers kernel/printk/printk.c:1911 [inline] console_unlock+0x82a/0xb40 kernel/printk/printk.c:2532 register_console kernel/printk/printk.c:2873 [inline] register_console+0x53d/0x800 kernel/printk/printk.c:2763 univ8250_console_init+0x3a/0x4a drivers/tty/serial/8250/8250_core.c:700 console_init+0x24c/0x356 kernel/printk/printk.c:2983 start_kernel+0x2e6/0x489 init/main.c:979 secondary_startup_64_no_verify+0xc2/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_trylock_spinning kernel/printk/printk.c:1854 [inline] vprintk_emit+0x307/0x4d0 kernel/printk/printk.c:2053 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xf1 kernel/printk/printk.c:2102 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:1193 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 process_output_block drivers/tty/n_tty.c:591 [inline] n_tty_write+0x416/0xfe0 drivers/tty/n_tty.c:2384 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:1964 [inline] new_sync_write+0x42c/0x660 fs/read_write.c:518 vfs_write+0x747/0xa70 fs/read_write.c:605 ksys_write+0x12d/0x260 fs/read_write.c:658 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x62/0xc7 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 *** 5 locks held by syz-executor.0/6881: #0: ffff8880478f6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x90 drivers/tty/tty_ldisc.c:267 #1: ffff8880478f6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:953 [inline] #1: ffff8880478f6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:976 [inline] #1: ffff8880478f6130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x29f/0x910 drivers/tty/tty_io.c:1119 #2: ffff8880478f62e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: n_tty_write+0x1bf/0xfe0 drivers/tty/n_tty.c:2367 #3: ffffc90000769378 (&ldata->output_lock){+.+.}-{3:3}, at: process_output_block drivers/tty/n_tty.c:546 [inline] #3: ffffc90000769378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x542/0xfe0 drivers/tty/n_tty.c:2384 #4: ffff88801b1e4958 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x2b/0x160 drivers/tty/tty_buffer.c:575 stack backtrace: CPU: 0 PID: 6881 Comm: syz-executor.0 Not tainted 5.10.214 #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_trylock_spinning kernel/printk/printk.c:1854 [inline] vprintk_emit+0x307/0x4d0 kernel/printk/printk.c:2053 vprintk_func+0x8b/0x140 kernel/printk/printk_safe.c:401 printk+0xba/0xf1 kernel/printk/printk.c:2102 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:1193 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 process_output_block drivers/tty/n_tty.c:591 [inline] n_tty_write+0x416/0xfe0 drivers/tty/n_tty.c:2384 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:1964 [inline] new_sync_write+0x42c/0x660 fs/read_write.c:518 vfs_write+0x747/0xa70 fs/read_write.c:605 ksys_write+0x12d/0x260 fs/read_write.c:658 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x62/0xc7 RIP: 0033:0x7fcf7d41ab19 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:00007fcf7a990188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fcf7d52df60 RCX: 00007fcf7d41ab19 RDX: 000000000000fdef RSI: 0000000020000c80 RDI: 0000000000000004 RBP: 00007fcf7a9901d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf360c15f R14: 00007fcf7a990300 R15: 0000000000022000 audit: type=1326 audit(1712630836.693:906): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=6867 comm="syz-executor.4" exe="/syz-executor.4" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f5b4d031b19 code=0x7ffc0000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 6875 Comm: syz-executor.4 Not tainted 5.10.214 #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 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] __kmalloc_node_track_caller+0x74/0x3b0 mm/slub.c:4496 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb1/0x5b0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1102 [inline] nlmsg_new include/net/netlink.h:953 [inline] audit_buffer_alloc kernel/audit.c:1799 [inline] audit_log_start.part.0+0x2a3/0x730 kernel/audit.c:1917 audit_log_start+0x5f/0x90 kernel/audit.c:1873 audit_seccomp+0x5d/0x200 kernel/auditsc.c:2722 seccomp_log kernel/seccomp.c:773 [inline] __seccomp_filter+0x669/0x1530 kernel/seccomp.c:1016 __secure_computing+0x191/0x2f0 kernel/seccomp.c:1082 syscall_trace_enter.constprop.0+0x84/0x1e0 kernel/entry/common.c:58 do_syscall_64+0xf/0x40 arch/x86/entry/common.c:41 entry_SYSCALL_64_after_hwframe+0x62/0xc7 RIP: 0033:0x7f5b4cfe469c Code: ec 28 48 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 fc ff ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 48 89 44 24 08 e8 2f fd ff ff 48 RSP: 002b:00007f5b4a5a7170 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5b4cfe469c RDX: 000000000000000f RSI: 00007f5b4a5a71e0 RDI: 0000000000000005 RBP: 00007f5b4a5a71d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fff5c953e3f R14: 00007f5b4a5a7300 R15: 0000000000022000 audit: audit_lost=6 audit_rate_limit=0 audit_backlog_limit=64 audit: out of memory in audit_log_start audit: type=1326 audit(1712630836.801:907): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=6867 comm="syz-executor.4" exe="/syz-executor.4" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f5b4d031b19 code=0x7ffc0000 audit: type=1326 audit(1712630836.857:908): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=6867 comm="syz-executor.4" exe="/syz-executor.4" sig=0 arch=c000003e syscall=257 compat=0 ip=0x7f5b4cfe4a04 code=0x7ffc0000 audit: type=1326 audit(1712630836.857:909): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=6867 comm="syz-executor.4" exe="/syz-executor.4" sig=0 arch=c000003e syscall=1 compat=0 ip=0x7f5b4cfe45ff code=0x7ffc0000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 6902 Comm: syz-executor.0 Not tainted 5.10.214 #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 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] kmem_cache_alloc+0x5b/0x310 mm/slub.c:2909 mem_pool_alloc mm/kmemleak.c:423 [inline] create_object.isra.0+0x3a/0xa20 mm/kmemleak.c:578 kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline] slab_post_alloc_hook mm/slab.h:534 [inline] slab_alloc_node mm/slub.c:2896 [inline] slab_alloc mm/slub.c:2904 [inline] __kmalloc+0x16e/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 process_output_block drivers/tty/n_tty.c:591 [inline] n_tty_write+0x416/0xfe0 drivers/tty/n_tty.c:2384 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:1964 [inline] new_sync_write+0x42c/0x660 fs/read_write.c:518 vfs_write+0x747/0xa70 fs/read_write.c:605 ksys_write+0x12d/0x260 fs/read_write.c:658 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x62/0xc7 RIP: 0033:0x7fcf7d41ab19 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:00007fcf7a990188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fcf7d52df60 RCX: 00007fcf7d41ab19 RDX: 000000000000fdef RSI: 0000000020000c80 RDI: 0000000000000004 RBP: 00007fcf7a9901d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf360c15f R14: 00007fcf7a990300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 6908 Comm: syz-executor.4 Not tainted 5.10.214 #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 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] __kmalloc_node_track_caller+0x74/0x3b0 mm/slub.c:4496 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb1/0x5b0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1102 [inline] nlmsg_new include/net/netlink.h:953 [inline] audit_buffer_alloc kernel/audit.c:1799 [inline] audit_log_start.part.0+0x2a3/0x730 kernel/audit.c:1917 audit_log_start+0x5f/0x90 kernel/audit.c:1873 audit_seccomp+0x5d/0x200 kernel/auditsc.c:2722 seccomp_log kernel/seccomp.c:773 [inline] __seccomp_filter+0x669/0x1530 kernel/seccomp.c:1016 __secure_computing+0x191/0x2f0 kernel/seccomp.c:1082 syscall_trace_enter.constprop.0+0x84/0x1e0 kernel/entry/common.c:58 do_syscall_64+0xf/0x40 arch/x86/entry/common.c:41 entry_SYSCALL_64_after_hwframe+0x62/0xc7 RIP: 0033:0x7f5b4cfe469c Code: ec 28 48 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 fc ff ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 48 89 44 24 08 e8 2f fd ff ff 48 RSP: 002b:00007f5b4a5a7170 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5b4cfe469c RDX: 000000000000000f RSI: 00007f5b4a5a71e0 RDI: 0000000000000005 RBP: 00007f5b4a5a71d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fff5c953e3f R14: 00007f5b4a5a7300 R15: 0000000000022000