FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 ====================================================== WARNING: possible circular locking dependency detected 5.15.120-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/18778 is trying to acquire lock: ffff800014ab7d60 (console_owner){-.-.}-{0:0}, at: console_trylock_spinning+0xe4/0x280 kernel/printk/printk.c:1879 but task is already holding lock: ffff0000d2c90158 (&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+0xd04/0x157c drivers/tty/serial/amba-pl011.c:1505 pl011_start_tx_pio drivers/tty/serial/amba-pl011.c:1351 [inline] pl011_start_tx+0x364/0x8b8 drivers/tty/serial/amba-pl011.c:1363 __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:2322 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:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c 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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 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:2354 call_console_drivers kernel/printk/printk.c:1953 [inline] console_unlock+0xbac/0x1394 kernel/printk/printk.c:2734 register_console+0x560/0x870 kernel/printk/printk.c:3064 uart_configure_port drivers/tty/serial/serial_core.c:2443 [inline] uart_add_one_port+0xe70/0x1540 drivers/tty/serial/serial_core.c:2958 pl011_register_port+0x1a0/0x434 drivers/tty/serial/amba-pl011.c:2799 sbsa_uart_probe+0x474/0x5dc drivers/tty/serial/amba-pl011.c:2934 platform_probe+0x148/0x1c0 drivers/base/platform.c:1411 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:427 __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:487 device_add+0xae0/0xef4 drivers/base/core.c:3394 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:2087 acpi_bus_attach+0x88c/0xab4 drivers/acpi/scan.c:2197 acpi_bus_attach+0x314/0xab4 drivers/acpi/scan.c:2203 acpi_bus_attach+0x314/0xab4 drivers/acpi/scan.c:2203 acpi_bus_scan+0xe4/0x20c drivers/acpi/scan.c:2375 acpi_scan_init+0x220/0x71c drivers/acpi/scan.c:2550 acpi_init+0x188/0x24c drivers/acpi/bus.c:1346 do_one_initcall+0x234/0x990 init/main.c:1306 do_initcall_level+0x154/0x214 init/main.c:1379 do_initcalls+0x58/0xac init/main.c:1395 do_basic_setup+0x8c/0xa0 init/main.c:1414 kernel_init_freeable+0x470/0x650 init/main.c:1619 kernel_init+0x24/0x294 init/main.c:1510 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:3787 [inline] __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 console_trylock_spinning+0x110/0x280 kernel/printk/printk.c:1896 vprintk_emit+0x120/0x218 kernel/printk/printk.c:2267 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2279 vprintk+0x218/0x2f0 kernel/printk/printk_safe.c:50 _printk+0xdc/0x128 kernel/printk/printk.c:2289 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x3e0/0x5cc lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1337 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 n_tty_write+0x4f4/0xf38 drivers/tty/n_tty.c:2345 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x44c/0x758 drivers/tty/tty_io.c:1110 tty_write+0x48/0x58 drivers/tty/tty_io.c:1131 call_write_iter include/linux/fs.h:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c 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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 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 *** 5 locks held by syz-executor.5/18778: #0: ffff0000ce095098 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x40/0x50 drivers/tty/tty_ldsem.c:340 #1: ffff0000ce095130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:961 [inline] #1: ffff0000ce095130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:984 [inline] #1: ffff0000ce095130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x1d4/0x758 drivers/tty/tty_io.c:1110 #2: ffff0000ce0952e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1ec/0xf38 drivers/tty/n_tty.c:2305 #3: ffff80001f55d378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x4b0/0xf38 drivers/tty/n_tty.c:2344 #4: ffff0000d2c90158 (&port->lock){....}-{2:2}, at: tty_insert_flip_string_and_push_buffer+0x48/0x324 drivers/tty/tty_buffer.c:585 stack backtrace: CPU: 1 PID: 18778 Comm: syz-executor.5 Not tainted 5.15.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 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:3787 [inline] __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 console_trylock_spinning+0x110/0x280 kernel/printk/printk.c:1896 vprintk_emit+0x120/0x218 kernel/printk/printk.c:2267 vprintk_default+0xa0/0xe4 kernel/printk/printk.c:2279 vprintk+0x218/0x2f0 kernel/printk/printk_safe.c:50 _printk+0xdc/0x128 kernel/printk/printk.c:2289 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x3e0/0x5cc lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1337 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 n_tty_write+0x4f4/0xf38 drivers/tty/n_tty.c:2345 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x44c/0x758 drivers/tty/tty_io.c:1110 tty_write+0x48/0x58 drivers/tty/tty_io.c:1131 call_write_iter include/linux/fs.h:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c 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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 CPU: 1 PID: 18778 Comm: syz-executor.5 Not tainted 5.15.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 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+0x400/0x5cc lib/fault-inject.c:146 __should_failslab+0xbc/0x110 mm/failslab.c:33 should_failslab+0x10/0x28 mm/slab_common.c:1337 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 n_tty_write+0x4f4/0xf38 drivers/tty/n_tty.c:2345 do_tty_write drivers/tty/tty_io.c:1038 [inline] file_tty_write+0x44c/0x758 drivers/tty/tty_io.c:1110 tty_write+0x48/0x58 drivers/tty/tty_io.c:1131 call_write_iter include/linux/fs.h:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c 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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584