Extracting prog: 2m11.320754935s Minimizing prog: 10m1.792404197s Simplifying prog options: 0s Extracting C: 46.700509697s Simplifying C: 7m43.956814325s extracting reproducer from 37 programs first checking the prog from the crash report single: executing 1 programs separately with timeout 30s testing program (duration=30s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-ioctl$TIOCSETD-dup-write$6lowpan_enable-ioctl$TIOCVHANGUP detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) ioctl$TIOCSETD(r0, 0x5423, &(0x7f0000000040)=0xd) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) ioctl$TIOCVHANGUP(r0, 0x5437, 0x0) program crashed: possible deadlock in console_lock_spinning_enable single: successfully extracted reproducer found reproducer with 5 syscalls minimizing guilty program testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-ioctl$TIOCSETD-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) ioctl$TIOCSETD(r0, 0x5423, &(0x7f0000000040)=0xd) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program crashed: possible deadlock in console_lock_spinning_enable testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-ioctl$TIOCSETD-dup detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) ioctl$TIOCSETD(r0, 0x5423, &(0x7f0000000040)=0xd) dup(r0) program did not crash testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-ioctl$TIOCSETD-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) ioctl$TIOCSETD(r0, 0x5423, &(0x7f0000000040)=0xd) write$6lowpan_enable(0xffffffffffffffff, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program did not crash testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program crashed: possible deadlock in console_lock_spinning_enable testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): dup-write$6lowpan_enable detailed listing: executing program 0: r0 = dup(0xffffffffffffffff) write$6lowpan_enable(r0, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program did not crash testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) program did not crash testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, 0x0, 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program did not crash testing program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, 0x0, 0x0) (fail_nth: 3) program did not crash extracting C reproducer testing compiled C program (duration=46.778302177s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable simplifying C reproducer testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:true Sysctl:true Swap:false UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:true Swap:false UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:true Swap:false UseTmpDir:false HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:true Swap:false UseTmpDir:false HandleSegv:false Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing compiled C program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:false HandleSegv:false Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable program crashed: possible deadlock in console_lock_spinning_enable testing program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:false HandleSegv:false Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program crashed: possible deadlock in console_lock_spinning_enable validation run: crashed=true testing program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:false HandleSegv:false Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program crashed: possible deadlock in console_lock_spinning_enable validation run: crashed=true testing program (duration=46.778302177s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: SandboxArg:0 Leak:false NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false NicVF:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false Swap:false UseTmpDir:false HandleSegv:false Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): openat$ptmx-dup-write$6lowpan_enable detailed listing: executing program 0: r0 = openat$ptmx(0xffffffffffffff9c, &(0x7f00000000c0), 0x2, 0x0) r1 = dup(r0) write$6lowpan_enable(r1, &(0x7f0000000000)='0', 0xfffffd2c) (fail_nth: 3) program crashed: possible deadlock in console_lock_spinning_enable validation run: crashed=true reproducing took 23m34.644261555s repro crashed as (corrupted=false): FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.17/4323 is trying to acquire lock: ffffffff8c3139a0 (console_owner){....}-{0:0}, at: console_lock_spinning_enable+0x2c/0x60 kernel/printk/printk.c:1802 but task is already holding lock: ffff888076e94958 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x39/0x380 drivers/tty/tty_buffer.c:585 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+0xb0/0x100 kernel/locking/spinlock.c:162 tty_port_tty_get drivers/tty/tty_port.c:289 [inline] tty_port_default_wakeup+0x1f/0xf0 drivers/tty/tty_port.c:48 serial8250_tx_chars+0x615/0x800 drivers/tty/serial/8250/8250_port.c:1828 serial8250_handle_irq+0x4f5/0x5f0 drivers/tty/serial/8250/8250_port.c:1924 serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941 serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x299/0x9d0 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213 handle_edge_irq+0x242/0xb20 kernel/irq/chip.c:819 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:233 [inline] __common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667 native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline] default_idle+0xb/0x10 arch/x86/kernel/process.c:729 default_idle_call+0x81/0xc0 kernel/sched/idle.c:112 cpuidle_idle_call kernel/sched/idle.c:202 [inline] do_idle+0x251/0x650 kernel/sched/idle.c:326 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:424 start_secondary+0x32f/0x430 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xb1/0xbb -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162 serial8250_console_write+0x16c/0xf50 drivers/tty/serial/8250/8250_port.c:3368 call_console_drivers kernel/printk/printk.c:-1 [inline] console_unlock+0xb47/0x10f0 kernel/printk/printk.c:2744 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 register_console+0x693/0x970 kernel/printk/printk.c:3107 univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690 console_init+0x177/0x5d0 kernel/printk/printk.c:3207 start_kernel+0x2fc/0x540 init/main.c:1089 secondary_startup_64_no_verify+0xb1/0xbb -> #0 (console_owner){....}-{0:0}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805 console_unlock+0x8b5/0x10f0 kernel/printk/printk.c:2741 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x364/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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.0.17/4323: #0: ffff888024787098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252 #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:961 [inline] #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:984 [inline] #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x23c/0x8a0 drivers/tty/tty_io.c:1110 #2: ffff8880247872e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1ec/0x1220 drivers/tty/n_tty.c:2322 #3: ffffc9000132c378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x592/0x1220 drivers/tty/n_tty.c:2361 #4: ffff888076e94958 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x39/0x380 drivers/tty/tty_buffer.c:585 #5: ffffffff8c313a80 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0xa7/0x150 kernel/printk/printk.c:2273 stack backtrace: CPU: 0 PID: 4323 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805 console_unlock+0x8b5/0x10f0 kernel/printk/printk.c:2741 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x364/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa53c67fe59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdb97b8488 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa53c907fa0 RCX: 00007fa53c67fe59 RDX: 00000000fffffd2c RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007ffdb97b84f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fa53c907fac R14: 00007fa53c907fa0 R15: 00007fa53c907fa0 CPU: 0 PID: 4323 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail+0x383/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa53c67fe59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdb97b8488 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa53c907fa0 RCX: 00007fa53c67fe59 RDX: 00000000fffffd2c RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007ffdb97b84f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fa53c907fac R14: 00007fa53c907fa0 R15: 00007fa53c907fa0 final repro crashed as (corrupted=false): FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.17/4323 is trying to acquire lock: ffffffff8c3139a0 (console_owner){....}-{0:0}, at: console_lock_spinning_enable+0x2c/0x60 kernel/printk/printk.c:1802 but task is already holding lock: ffff888076e94958 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x39/0x380 drivers/tty/tty_buffer.c:585 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+0xb0/0x100 kernel/locking/spinlock.c:162 tty_port_tty_get drivers/tty/tty_port.c:289 [inline] tty_port_default_wakeup+0x1f/0xf0 drivers/tty/tty_port.c:48 serial8250_tx_chars+0x615/0x800 drivers/tty/serial/8250/8250_port.c:1828 serial8250_handle_irq+0x4f5/0x5f0 drivers/tty/serial/8250/8250_port.c:1924 serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941 serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127 __handle_irq_event_percpu+0x299/0x9d0 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213 handle_edge_irq+0x242/0xb20 kernel/irq/chip.c:819 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:233 [inline] __common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667 native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline] default_idle+0xb/0x10 arch/x86/kernel/process.c:729 default_idle_call+0x81/0xc0 kernel/sched/idle.c:112 cpuidle_idle_call kernel/sched/idle.c:202 [inline] do_idle+0x251/0x650 kernel/sched/idle.c:326 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:424 start_secondary+0x32f/0x430 arch/x86/kernel/smpboot.c:281 secondary_startup_64_no_verify+0xb1/0xbb -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162 serial8250_console_write+0x16c/0xf50 drivers/tty/serial/8250/8250_port.c:3368 call_console_drivers kernel/printk/printk.c:-1 [inline] console_unlock+0xb47/0x10f0 kernel/printk/printk.c:2744 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 register_console+0x693/0x970 kernel/printk/printk.c:3107 univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690 console_init+0x177/0x5d0 kernel/printk/printk.c:3207 start_kernel+0x2fc/0x540 init/main.c:1089 secondary_startup_64_no_verify+0xb1/0xbb -> #0 (console_owner){....}-{0:0}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805 console_unlock+0x8b5/0x10f0 kernel/printk/printk.c:2741 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x364/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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.0.17/4323: #0: ffff888024787098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252 #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:961 [inline] #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:984 [inline] #1: ffff888024787130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x23c/0x8a0 drivers/tty/tty_io.c:1110 #2: ffff8880247872e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1ec/0x1220 drivers/tty/n_tty.c:2322 #3: ffffc9000132c378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x592/0x1220 drivers/tty/n_tty.c:2361 #4: ffff888076e94958 (&port->lock){-.-.}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x39/0x380 drivers/tty/tty_buffer.c:585 #5: ffffffff8c313a80 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0xa7/0x150 kernel/printk/printk.c:2273 stack backtrace: CPU: 0 PID: 4323 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805 console_unlock+0x8b5/0x10f0 kernel/printk/printk.c:2741 vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274 _printk+0xda/0x130 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x364/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa53c67fe59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdb97b8488 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa53c907fa0 RCX: 00007fa53c67fe59 RDX: 00000000fffffd2c RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007ffdb97b84f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fa53c907fac R14: 00007fa53c907fa0 R15: 00007fa53c907fa0 CPU: 0 PID: 4323 Comm: syz.0.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail+0x383/0x4b0 lib/fault-inject.c:146 should_failslab+0x5/0x20 mm/slab_common.c:1350 slab_pre_alloc_hook+0x51/0xc0 mm/slab.h:494 slab_alloc_node mm/slub.c:3139 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x6b/0x340 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1db/0x500 drivers/tty/tty_buffer.c:276 tty_insert_flip_string_fixed_flag drivers/tty/tty_buffer.c:322 [inline] tty_insert_flip_string include/linux/tty_flip.h:41 [inline] tty_insert_flip_string_and_push_buffer+0x7e/0x380 drivers/tty/tty_buffer.c:586 n_tty_write+0x5dc/0x1220 drivers/tty/n_tty.c:2362 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x50c/0x8a0 drivers/tty/tty_io.c:1110 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa53c67fe59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdb97b8488 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa53c907fa0 RCX: 00007fa53c67fe59 RDX: 00000000fffffd2c RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007ffdb97b84f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fa53c907fac R14: 00007fa53c907fa0 R15: 00007fa53c907fa0