FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 ====================================================== WARNING: possible circular locking dependency detected 5.15.168-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.334/5210 is trying to acquire lock: ffff800014c786a0 (console_owner){-.-.}-{0:0}, at: console_lock_spinning_enable+0x38/0x78 kernel/printk/printk.c:1802 but task is already holding lock: ffff0000db754158 (&port->lock){....}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x48/0x324 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+0xc4/0x14c kernel/locking/spinlock.c:162 tty_port_tty_get+0x2c/0x124 drivers/tty/tty_port.c:289 tty_port_default_wakeup+0x20/0x54 drivers/tty/tty_port.c:48 tty_port_tty_wakeup+0x64/0x78 drivers/tty/tty_port.c:389 uart_write_wakeup+0x4c/0x64 drivers/tty/serial/serial_core.c:111 pl011_tx_chars+0xb00/0x1298 drivers/tty/serial/amba-pl011.c:1501 pl011_start_tx_pio drivers/tty/serial/amba-pl011.c:1347 [inline] pl011_start_tx+0x570/0xbb4 drivers/tty/serial/amba-pl011.c:1389 __uart_start drivers/tty/serial/serial_core.c:132 [inline] uart_write+0x62c/0x8b8 drivers/tty/serial/serial_core.c:589 process_output_block drivers/tty/n_tty.c:592 [inline] n_tty_write+0xae0/0xf38 drivers/tty/n_tty.c:2339 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x44c/0x758 drivers/tty/tty_io.c:1110 tty_write drivers/tty/tty_io.c:1131 [inline] redirected_tty_write+0xc4/0x10c drivers/tty/tty_io.c:1154 call_write_iter include/linux/fs.h:2174 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x884/0xb44 fs/read_write.c:594 ksys_write+0x15c/0x26c fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:656 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0xb0/0x10c kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] pl011_console_write+0x1a0/0x774 drivers/tty/serial/amba-pl011.c:2350 call_console_drivers kernel/printk/printk.c:1959 [inline] console_unlock+0xbac/0x1394 kernel/printk/printk.c:2744 register_console+0x57c/0x88c kernel/printk/printk.c:3097 uart_configure_port drivers/tty/serial/serial_core.c:2463 [inline] uart_add_one_port+0x1024/0x17cc drivers/tty/serial/serial_core.c:2978 pl011_register_port+0x1a0/0x434 drivers/tty/serial/amba-pl011.c:2795 sbsa_uart_probe+0x474/0x5dc drivers/tty/serial/amba-pl011.c:2930 platform_probe+0x148/0x1c0 drivers/base/platform.c:1391 really_probe+0x26c/0xaec drivers/base/dd.c:595 __driver_probe_device+0x194/0x3b4 drivers/base/dd.c:755 driver_probe_device+0x78/0x34c drivers/base/dd.c:785 __device_attach_driver+0x28c/0x4d8 drivers/base/dd.c:907 bus_for_each_drv+0x158/0x1e0 drivers/base/bus.c:429 __device_attach+0x2f0/0x480 drivers/base/dd.c:979 device_initial_probe+0x24/0x34 drivers/base/dd.c:1028 bus_probe_device+0xbc/0x1c8 drivers/base/bus.c:489 device_add+0xae0/0xef4 drivers/base/core.c:3415 platform_device_add+0x3f8/0x708 drivers/base/platform.c:712 platform_device_register_full+0x508/0x618 drivers/base/platform.c:835 acpi_create_platform_device+0x4d8/0x650 drivers/acpi/acpi_platform.c:154 acpi_default_enumeration+0x6c/0xdc drivers/acpi/scan.c:2083 acpi_bus_attach+0x88c/0xab4 drivers/acpi/scan.c:2193 acpi_bus_attach+0x314/0xab4 drivers/acpi/scan.c:2199 acpi_bus_attach+0x314/0xab4 drivers/acpi/scan.c:2199 acpi_bus_scan+0xe4/0x20c drivers/acpi/scan.c:2371 acpi_scan_init+0x220/0x71c drivers/acpi/scan.c:2546 acpi_init+0x188/0x24c drivers/acpi/bus.c:1354 do_one_initcall+0x234/0x990 init/main.c:1302 do_initcall_level+0x154/0x214 init/main.c:1375 do_initcalls+0x58/0xac init/main.c:1391 do_basic_setup+0x8c/0xa0 init/main.c:1410 kernel_init_freeable+0x460/0x640 init/main.c:1615 kernel_init+0x24/0x294 init/main.c:1506 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 -> #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+0x32d4/0x7638 kernel/locking/lockdep.c:5012 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x68/0x78 kernel/printk/printk.c:1805 console_unlock+0x910/0x1394 kernel/printk/printk.c:2741 vprintk_emit+0x140/0x21c kernel/printk/printk.c:2274 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2289 vprintk+0x200/0x2d4 kernel/printk/printk_safe.c:45 _printk+0xdc/0x128 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x398/0x514 lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1344 slab_pre_alloc_hook+0x64/0xe8 mm/slab.h:494 slab_alloc_node mm/slub.c:3134 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0xc0/0x4c8 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1a4/0x440 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+0x74/0x324 drivers/tty/tty_buffer.c:586 pty_write+0xb8/0xe8 drivers/tty/pty.c:118 tty_put_char+0x110/0x170 drivers/tty/tty_io.c:3179 __process_echoes+0x3f8/0xd54 drivers/tty/n_tty.c:725 flush_echoes drivers/tty/n_tty.c:826 [inline] __receive_buf drivers/tty/n_tty.c:1579 [inline] n_tty_receive_buf_common+0x5578/0x5b50 drivers/tty/n_tty.c:1674 n_tty_receive_buf+0x40/0x54 drivers/tty/n_tty.c:1714 tiocsti+0x284/0x35c drivers/tty/tty_io.c:2312 tty_ioctl+0x354/0xdf4 drivers/tty/tty_io.c:2724 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 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.334/5210: #0: ffff0000e23a1098 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x40/0x50 drivers/tty/tty_ldsem.c:340 #1: ffff0000db7518b8 (&port->buf.lock/1){+.+.}-{3:3}, at: tty_buffer_lock_exclusive+0x48/0x84 drivers/tty/tty_buffer.c:61 #2: ffff0000e23a12e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: n_tty_receive_buf_common+0x7c/0x5b50 drivers/tty/n_tty.c:1637 #3: ffff80002151b378 (&ldata->output_lock){+.+.}-{3:3}, at: flush_echoes drivers/tty/n_tty.c:824 [inline] #3: ffff80002151b378 (&ldata->output_lock){+.+.}-{3:3}, at: __receive_buf drivers/tty/n_tty.c:1579 [inline] #3: ffff80002151b378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_receive_buf_common+0x5544/0x5b50 drivers/tty/n_tty.c:1674 #4: ffff0000db754158 (&port->lock){....}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x48/0x324 drivers/tty/tty_buffer.c:585 #5: ffff800014b601a0 (console_lock){+.+.}-{0:0}, at: console_trylock_spinning+0x1c/0x288 kernel/printk/printk.c:1867 stack backtrace: CPU: 1 PID: 5210 Comm: syz.0.334 Not tainted 5.15.168-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011 check_noncircular+0x2cc/0x378 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+0x32d4/0x7638 kernel/locking/lockdep.c:5012 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 console_lock_spinning_enable+0x68/0x78 kernel/printk/printk.c:1805 console_unlock+0x910/0x1394 kernel/printk/printk.c:2741 vprintk_emit+0x140/0x21c kernel/printk/printk.c:2274 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2289 vprintk+0x200/0x2d4 kernel/printk/printk_safe.c:45 _printk+0xdc/0x128 kernel/printk/printk.c:2299 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x398/0x514 lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1344 slab_pre_alloc_hook+0x64/0xe8 mm/slab.h:494 slab_alloc_node mm/slub.c:3134 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0xc0/0x4c8 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1a4/0x440 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+0x74/0x324 drivers/tty/tty_buffer.c:586 pty_write+0xb8/0xe8 drivers/tty/pty.c:118 tty_put_char+0x110/0x170 drivers/tty/tty_io.c:3179 __process_echoes+0x3f8/0xd54 drivers/tty/n_tty.c:725 flush_echoes drivers/tty/n_tty.c:826 [inline] __receive_buf drivers/tty/n_tty.c:1579 [inline] n_tty_receive_buf_common+0x5578/0x5b50 drivers/tty/n_tty.c:1674 n_tty_receive_buf+0x40/0x54 drivers/tty/n_tty.c:1714 tiocsti+0x284/0x35c drivers/tty/tty_io.c:2312 tty_ioctl+0x354/0xdf4 drivers/tty/tty_io.c:2724 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 CPU: 1 PID: 5210 Comm: syz.0.334 Not tainted 5.15.168-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:52 [inline] should_fail+0x3b8/0x514 lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1344 slab_pre_alloc_hook+0x64/0xe8 mm/slab.h:494 slab_alloc_node mm/slub.c:3134 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0xc0/0x4c8 mm/slub.c:4403 kmalloc include/linux/slab.h:596 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:177 [inline] __tty_buffer_request_room+0x1a4/0x440 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+0x74/0x324 drivers/tty/tty_buffer.c:586 pty_write+0xb8/0xe8 drivers/tty/pty.c:118 tty_put_char+0x110/0x170 drivers/tty/tty_io.c:3179 __process_echoes+0x3f8/0xd54 drivers/tty/n_tty.c:725 flush_echoes drivers/tty/n_tty.c:826 [inline] __receive_buf drivers/tty/n_tty.c:1579 [inline] n_tty_receive_buf_common+0x5578/0x5b50 drivers/tty/n_tty.c:1674 n_tty_receive_buf+0x40/0x54 drivers/tty/n_tty.c:1714 tiocsti+0x284/0x35c drivers/tty/tty_io.c:2312 tty_ioctl+0x354/0xdf4 drivers/tty/tty_io.c:2724 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584