Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.77' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 33.169261] FAULT_INJECTION: forcing a failure. [ 33.169261] name failslab, interval 1, probability 0, space 0, times 1 [ 33.181276] CPU: 0 PID: 8091 Comm: syz-executor176 Not tainted 4.19.211-syzkaller #0 [ 33.189135] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 33.198466] Call Trace: [ 33.201082] dump_stack+0x1fc/0x2ef [ 33.204698] should_fail.cold+0xa/0xf [ 33.208486] ? setup_fault_attr+0x200/0x200 [ 33.212789] ? mark_held_locks+0xf0/0xf0 [ 33.216830] ? lock_acquire+0x170/0x3c0 [ 33.220786] __should_failslab+0x115/0x180 [ 33.225001] should_failslab+0x5/0x10 [ 33.228781] __kmalloc+0x6d/0x3c0 [ 33.232212] ? tty_buffer_alloc+0x23f/0x2a0 [ 33.236513] ? __mutex_lock+0x368/0x1190 [ 33.240555] tty_buffer_alloc+0x23f/0x2a0 [ 33.244693] __tty_buffer_request_room+0x156/0x2a0 [ 33.249608] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.255126] ? do_raw_spin_lock+0xcb/0x220 [ 33.259345] pty_write+0x126/0x1f0 [ 33.262867] ? ptmx_open+0x350/0x350 [ 33.266570] n_tty_write+0x3c0/0xff0 [ 33.270268] ? n_tty_open+0x160/0x160 [ 33.274049] ? do_wait_intr_irq+0x270/0x270 [ 33.278352] ? __might_fault+0x192/0x1d0 [ 33.282416] tty_write+0x496/0x810 [ 33.285937] ? n_tty_open+0x160/0x160 [ 33.289718] __vfs_write+0xf7/0x770 [ 33.293331] ? tty_compat_ioctl+0x270/0x270 [ 33.297635] ? common_file_perm+0x4e5/0x850 [ 33.302056] ? kernel_read+0x110/0x110 [ 33.305939] ? trace_hardirqs_off+0x64/0x200 [ 33.310340] ? apparmor_getprocattr+0x11e0/0x11e0 [ 33.315172] ? vfs_write+0x3d7/0x540 [ 33.318879] ? security_file_permission+0x1c0/0x220 [ 33.323906] vfs_write+0x1f3/0x540 [ 33.327439] ksys_write+0x12b/0x2a0 [ 33.331050] ? __ia32_sys_read+0xb0/0xb0 [ 33.335092] ? trace_hardirqs_off_caller+0x6e/0x210 [ 33.340100] ? do_syscall_64+0x21/0x620 [ 33.344061] do_syscall_64+0xf9/0x620 [ 33.347859] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.353038] RIP: 0033:0x7f08af893789 [ 33.356741] Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48 [ 33.375629] RSP: 002b:00007fffaf8a9518 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 33.383319] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f08af893789 [ 33.390586] RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 [ 33.397837] RBP: 00007fffaf8a9530 R08: 0000000000000001 R09: 0000000000000001 [ 33.405085] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 33.412334] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 33.419609] [ 33.419612] ====================================================== [ 33.419615] WARNING: possible circular locking dependency detected [ 33.419617] 4.19.211-syzkaller #0 Not tainted [ 33.419620] ------------------------------------------------------ [ 33.419623] syz-executor176/8091 is trying to acquire lock: [ 33.419624] 000000009d056479 (console_owner){....}, at: console_unlock+0x3a9/0x1110 [ 33.419632] [ 33.419634] but task is already holding lock: [ 33.419636] 0000000015594c38 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.419643] [ 33.419645] which lock already depends on the new lock. [ 33.419646] [ 33.419648] [ 33.419650] the existing dependency chain (in reverse order) is: [ 33.419652] [ 33.419653] -> #2 (&(&port->lock)->rlock){-.-.}: [ 33.419660] tty_port_tty_get+0x1d/0x80 [ 33.419662] tty_port_default_wakeup+0x11/0x40 [ 33.419665] serial8250_tx_chars+0x490/0xaf0 [ 33.419667] serial8250_handle_irq.part.0+0x31f/0x3d0 [ 33.419669] serial8250_default_handle_irq+0xae/0x220 [ 33.419672] serial8250_interrupt+0x101/0x240 [ 33.419674] __handle_irq_event_percpu+0x27e/0x8e0 [ 33.419676] handle_irq_event+0x102/0x290 [ 33.419678] handle_edge_irq+0x260/0xcf0 [ 33.419680] handle_irq+0x35/0x50 [ 33.419682] do_IRQ+0x93/0x1c0 [ 33.419684] ret_from_intr+0x0/0x1e [ 33.419686] lock_acquire+0x1ec/0x3c0 [ 33.419688] gc_worker+0x195/0xe90 [ 33.419690] process_one_work+0x864/0x1570 [ 33.419692] worker_thread+0x64c/0x1130 [ 33.419694] kthread+0x33f/0x460 [ 33.419696] ret_from_fork+0x24/0x30 [ 33.419697] [ 33.419698] -> #1 (&port_lock_key){-.-.}: [ 33.419705] serial8250_console_write+0x90e/0xb70 [ 33.419707] console_unlock+0xbb6/0x1110 [ 33.419709] vprintk_emit+0x2d1/0x740 [ 33.419711] vprintk_func+0x79/0x180 [ 33.419713] printk+0xba/0xed [ 33.419715] register_console+0x87f/0xc90 [ 33.419717] univ8250_console_init+0x3a/0x46 [ 33.419719] console_init+0x4cb/0x718 [ 33.419721] start_kernel+0x686/0x911 [ 33.419723] secondary_startup_64+0xa4/0xb0 [ 33.419724] [ 33.419725] -> #0 (console_owner){....}: [ 33.419732] console_unlock+0x411/0x1110 [ 33.419734] vprintk_emit+0x2d1/0x740 [ 33.419736] vprintk_func+0x79/0x180 [ 33.419738] printk+0xba/0xed [ 33.419740] should_fail+0x66b/0x7b0 [ 33.419742] __should_failslab+0x115/0x180 [ 33.419744] should_failslab+0x5/0x10 [ 33.419746] __kmalloc+0x6d/0x3c0 [ 33.419748] tty_buffer_alloc+0x23f/0x2a0 [ 33.419750] __tty_buffer_request_room+0x156/0x2a0 [ 33.419753] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.419755] pty_write+0x126/0x1f0 [ 33.419757] n_tty_write+0x3c0/0xff0 [ 33.419759] tty_write+0x496/0x810 [ 33.419761] __vfs_write+0xf7/0x770 [ 33.419762] vfs_write+0x1f3/0x540 [ 33.419764] ksys_write+0x12b/0x2a0 [ 33.419766] do_syscall_64+0xf9/0x620 [ 33.419769] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.419770] [ 33.419772] other info that might help us debug this: [ 33.419773] [ 33.419775] Chain exists of: [ 33.419776] console_owner --> &port_lock_key --> &(&port->lock)->rlock [ 33.419785] [ 33.419787] Possible unsafe locking scenario: [ 33.419788] [ 33.419790] CPU0 CPU1 [ 33.419792] ---- ---- [ 33.419794] lock(&(&port->lock)->rlock); [ 33.419798] lock(&port_lock_key); [ 33.419803] lock(&(&port->lock)->rlock); [ 33.419807] lock(console_owner); [ 33.419811] [ 33.419813] *** DEADLOCK *** [ 33.419814] [ 33.419816] 6 locks held by syz-executor176/8091: [ 33.419817] #0: 0000000021d3f2e9 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 [ 33.419826] #1: 000000009a04e2b9 (&tty->atomic_write_lock){+.+.}, at: tty_write+0x24e/0x810 [ 33.419834] #2: 00000000d68de2b0 (&o_tty->termios_rwsem/1){++++}, at: n_tty_write+0x1b5/0xff0 [ 33.419844] #3: 00000000fa210163 (&ldata->output_lock){+.+.}, at: n_tty_write+0x4e3/0xff0 [ 33.419852] #4: 0000000015594c38 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.419861] #5: 00000000ca45cf83 (console_lock){+.+.}, at: vprintk_func+0x79/0x180 [ 33.419869] [ 33.419870] stack backtrace: [ 33.419874] CPU: 0 PID: 8091 Comm: syz-executor176 Not tainted 4.19.211-syzkaller #0 [ 33.419878] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 33.419879] Call Trace: [ 33.419881] dump_stack+0x1fc/0x2ef [ 33.419884] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 33.419886] __lock_acquire+0x30c9/0x3ff0 [ 33.419888] ? mark_held_locks+0xf0/0xf0 [ 33.419890] ? snprintf+0xf0/0xf0 [ 33.419892] ? console_unlock+0x3ec/0x1110 [ 33.419894] lock_acquire+0x170/0x3c0 [ 33.419896] ? console_unlock+0x3a9/0x1110 [ 33.419898] console_unlock+0x411/0x1110 [ 33.419900] ? console_unlock+0x3a9/0x1110 [ 33.419902] vprintk_emit+0x2d1/0x740 [ 33.419908] vprintk_func+0x79/0x180 [ 33.419910] printk+0xba/0xed [ 33.419912] ? log_store.cold+0x16/0x16 [ 33.419914] ? set_next_entity+0xb52/0x1dc0 [ 33.419916] ? __lock_acquire+0x6de/0x3ff0 [ 33.419918] ? ___ratelimit+0x319/0x590 [ 33.419920] should_fail+0x66b/0x7b0 [ 33.419922] ? setup_fault_attr+0x200/0x200 [ 33.419924] ? mark_held_locks+0xf0/0xf0 [ 33.419926] ? lock_acquire+0x170/0x3c0 [ 33.419928] __should_failslab+0x115/0x180 [ 33.419930] should_failslab+0x5/0x10 [ 33.419932] __kmalloc+0x6d/0x3c0 [ 33.419934] ? tty_buffer_alloc+0x23f/0x2a0 [ 33.419936] ? __mutex_lock+0x368/0x1190 [ 33.419938] tty_buffer_alloc+0x23f/0x2a0 [ 33.419941] __tty_buffer_request_room+0x156/0x2a0 [ 33.419943] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.419945] ? do_raw_spin_lock+0xcb/0x220 [ 33.419947] pty_write+0x126/0x1f0 [ 33.419949] ? ptmx_open+0x350/0x350 [ 33.419951] n_tty_write+0x3c0/0xff0 [ 33.419953] ? n_tty_open+0x160/0x160 [ 33.419955] ? do_wait_intr_irq+0x270/0x270 [ 33.419957] ? __might_fault+0x192/0x1d0 [ 33.419959] tty_write+0x496/0x810 [ 33.419961] ? n_tty_open+0x160/0x160 [ 33.419963] __vfs_write+0xf7/0x770 [ 33.419965] ? tty_compat_ioctl+0x270/0x270 [ 33.419967] ? common_file_perm+0x4e5/0x850 [ 33.419969] ? kernel_read+0x110/0x110 [ 33.419971] ? trace_hardirqs_off+0x64/0x200 [ 33.419974] ? apparmor_getprocattr+0x11e0/0x11e0 [ 33.419975] ? vfs_write+0x3d7/0x540 [ 33.419978] ? security_file_permission+0x1c0/0x220 [ 33.419980] vfs_write+0x1f3/0x540 [ 33.419982] ksys_write+0x12b/0x2a0 [ 33.419984] ? __ia32_sys_read+0xb0/0xb0 [ 33.419986] ? trace_hardirqs_off_caller+0x6e/0x210 [ 33.419988] ? do_syscall_64+0x21/0x620 [ 33.419990] do_syscall_64+0xf9/0x620 [ 33.419992] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.419994] RIP: 0033:0x7f08af893789 [ 33.420001] Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48 [ 33.420004] RSP: 002b:00007fffaf8a9518 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 33.420009] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f08af893789 [ 33.420012] RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 [ 33.420015] RBP: 00007fffaf8a9530 R08: 0000000000000001 R09: 0000000000000001 [ 33.420018] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 33.420021] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000