[ OK ] Started Getty on tty2. [ OK ] Started Getty on tty1. [ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Starting Load/Save RF Kill Switch Status... [ OK ] Started Load/Save RF Kill Switch Status. Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.130' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 32.873482] FAULT_INJECTION: forcing a failure. [ 32.873482] name failslab, interval 1, probability 0, space 0, times 1 [ 32.885591] CPU: 1 PID: 8093 Comm: syz-executor361 Not tainted 4.19.211-syzkaller #0 [ 32.893455] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.902801] Call Trace: [ 32.905372] dump_stack+0x1fc/0x2ef [ 32.908981] should_fail.cold+0xa/0xf [ 32.912798] ? setup_fault_attr+0x200/0x200 [ 32.917103] ? mark_held_locks+0xf0/0xf0 [ 32.921145] ? mark_held_locks+0xf0/0xf0 [ 32.925186] __should_failslab+0x115/0x180 [ 32.929402] should_failslab+0x5/0x10 [ 32.933199] __kmalloc+0x6d/0x3c0 [ 32.936665] ? tty_buffer_alloc+0x23f/0x2a0 [ 32.940990] tty_buffer_alloc+0x23f/0x2a0 [ 32.945129] __tty_buffer_request_room+0x156/0x2a0 [ 32.950039] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.955553] ? do_raw_spin_lock+0xcb/0x220 [ 32.959791] pty_write+0x126/0x1f0 [ 32.963313] ? trace_hardirqs_off+0x64/0x200 [ 32.967712] tty_put_char+0x122/0x150 [ 32.971494] ? dev_match_devt+0x90/0x90 [ 32.975449] ? tty_buffer_space_avail+0x7e/0xb0 [ 32.980097] ? pty_write_room+0xbe/0xe0 [ 32.984047] ? ptmx_open+0x350/0x350 [ 32.987740] __process_echoes+0x577/0x9f0 [ 32.991870] ? mark_held_locks+0xa6/0xf0 [ 32.995910] process_echoes+0xf9/0x1c0 [ 32.999780] n_tty_receive_char_special+0x8cc/0x29a0 [ 33.004865] ? n_tty_receive_buf_common+0x84/0x2a90 [ 33.009861] n_tty_receive_buf_common+0xac1/0x2a90 [ 33.014771] ? n_tty_receive_buf2+0x40/0x40 [ 33.019081] tty_ioctl+0x1026/0x1630 [ 33.022775] ? tty_fasync+0x300/0x300 [ 33.026554] ? get_pid_task+0xf4/0x190 [ 33.030420] ? proc_fail_nth_write+0x95/0x1d0 [ 33.034891] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.039801] ? debug_check_no_obj_freed+0x201/0x490 [ 33.044796] ? __vfs_write+0xff/0x770 [ 33.048577] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.053483] ? common_file_perm+0x4e5/0x850 [ 33.057792] ? tty_fasync+0x300/0x300 [ 33.061600] do_vfs_ioctl+0xcdb/0x12e0 [ 33.065487] ? vfs_write+0x3d7/0x540 [ 33.069183] ? ioctl_preallocate+0x200/0x200 [ 33.073575] ? lock_downgrade+0x720/0x720 [ 33.077706] ? check_preemption_disabled+0x41/0x280 [ 33.082705] ? vfs_write+0x393/0x540 [ 33.086400] ? ksys_write+0x1c8/0x2a0 [ 33.090182] ksys_ioctl+0x9b/0xc0 [ 33.093615] __x64_sys_ioctl+0x6f/0xb0 [ 33.097484] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.102049] do_syscall_64+0xf9/0x620 [ 33.105836] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.111002] RIP: 0033:0x7f2f9b210839 [ 33.114696] 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.133578] RSP: 002b:00007fff352436b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.141268] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f2f9b210839 [ 33.148516] RDX: 0000000020000140 RSI: 0000000000005412 RDI: 0000000000000004 [ 33.155765] RBP: 00007fff352436d0 R08: 0000000000000001 R09: 0000000000000001 [ 33.163012] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 33.170262] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 33.177521] [ 33.177524] ====================================================== [ 33.177527] WARNING: possible circular locking dependency detected [ 33.177529] 4.19.211-syzkaller #0 Not tainted [ 33.177532] ------------------------------------------------------ [ 33.177535] syz-executor361/8093 is trying to acquire lock: [ 33.177537] 000000001629c809 (console_owner){....}, at: console_unlock+0x3a9/0x1110 [ 33.177544] [ 33.177546] but task is already holding lock: [ 33.177548] 000000004dda7716 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.177555] [ 33.177557] which lock already depends on the new lock. [ 33.177558] [ 33.177560] [ 33.177562] the existing dependency chain (in reverse order) is: [ 33.177563] [ 33.177565] -> #2 (&(&port->lock)->rlock){-.-.}: [ 33.177572] tty_port_tty_get+0x1d/0x80 [ 33.177574] tty_port_default_wakeup+0x11/0x40 [ 33.177576] serial8250_tx_chars+0x490/0xaf0 [ 33.177579] serial8250_handle_irq.part.0+0x31f/0x3d0 [ 33.177581] serial8250_default_handle_irq+0xae/0x220 [ 33.177584] serial8250_interrupt+0x101/0x240 [ 33.177586] __handle_irq_event_percpu+0x27e/0x8e0 [ 33.177588] handle_irq_event+0x102/0x290 [ 33.177590] handle_edge_irq+0x260/0xcf0 [ 33.177592] handle_irq+0x35/0x50 [ 33.177594] do_IRQ+0x93/0x1c0 [ 33.177596] ret_from_intr+0x0/0x1e [ 33.177598] _raw_spin_unlock_irqrestore+0xa3/0xe0 [ 33.177600] uart_write+0x3bb/0x6f0 [ 33.177602] do_output_char+0x5de/0x850 [ 33.177604] n_tty_write+0x46e/0xff0 [ 33.177606] tty_write+0x496/0x810 [ 33.177608] redirected_tty_write+0xaa/0xb0 [ 33.177610] do_iter_write+0x461/0x5d0 [ 33.177612] vfs_writev+0x153/0x2e0 [ 33.177614] do_writev+0x136/0x330 [ 33.177616] do_syscall_64+0xf9/0x620 [ 33.177618] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.177619] [ 33.177620] -> #1 (&port_lock_key){-.-.}: [ 33.177628] serial8250_console_write+0x90e/0xb70 [ 33.177630] console_unlock+0xbb6/0x1110 [ 33.177632] vprintk_emit+0x2d1/0x740 [ 33.177634] vprintk_func+0x79/0x180 [ 33.177636] printk+0xba/0xed [ 33.177638] register_console+0x87f/0xc90 [ 33.177640] univ8250_console_init+0x3a/0x46 [ 33.177642] console_init+0x4cb/0x718 [ 33.177644] start_kernel+0x686/0x911 [ 33.177646] secondary_startup_64+0xa4/0xb0 [ 33.177647] [ 33.177648] -> #0 (console_owner){....}: [ 33.177655] console_unlock+0x411/0x1110 [ 33.177657] vprintk_emit+0x2d1/0x740 [ 33.177659] vprintk_func+0x79/0x180 [ 33.177661] printk+0xba/0xed [ 33.177663] should_fail+0x66b/0x7b0 [ 33.177665] __should_failslab+0x115/0x180 [ 33.177667] should_failslab+0x5/0x10 [ 33.177669] __kmalloc+0x6d/0x3c0 [ 33.177671] tty_buffer_alloc+0x23f/0x2a0 [ 33.177674] __tty_buffer_request_room+0x156/0x2a0 [ 33.177676] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.177678] pty_write+0x126/0x1f0 [ 33.177680] tty_put_char+0x122/0x150 [ 33.177682] __process_echoes+0x577/0x9f0 [ 33.177684] process_echoes+0xf9/0x1c0 [ 33.177687] n_tty_receive_char_special+0x8cc/0x29a0 [ 33.177689] n_tty_receive_buf_common+0xac1/0x2a90 [ 33.177691] tty_ioctl+0x1026/0x1630 [ 33.177693] do_vfs_ioctl+0xcdb/0x12e0 [ 33.177695] ksys_ioctl+0x9b/0xc0 [ 33.177697] __x64_sys_ioctl+0x6f/0xb0 [ 33.177699] do_syscall_64+0xf9/0x620 [ 33.177701] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.177703] [ 33.177705] other info that might help us debug this: [ 33.177706] [ 33.177708] Chain exists of: [ 33.177709] console_owner --> &port_lock_key --> &(&port->lock)->rlock [ 33.177718] [ 33.177720] Possible unsafe locking scenario: [ 33.177721] [ 33.177723] CPU0 CPU1 [ 33.177725] ---- ---- [ 33.177726] lock(&(&port->lock)->rlock); [ 33.177731] lock(&port_lock_key); [ 33.177736] lock(&(&port->lock)->rlock); [ 33.177740] lock(console_owner); [ 33.177744] [ 33.177745] *** DEADLOCK *** [ 33.177747] [ 33.177749] 6 locks held by syz-executor361/8093: [ 33.177750] #0: 00000000c218fcf4 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 [ 33.177758] #1: 00000000bc9f5390 (&port->buf.lock/1){+.+.}, at: tty_ioctl+0xfbc/0x1630 [ 33.177768] #2: 00000000d06a1e7b (&o_tty->termios_rwsem/1){++++}, at: n_tty_receive_buf_common+0x84/0x2a90 [ 33.177778] #3: 0000000081f6b60d (&ldata->output_lock){+.+.}, at: process_echoes+0xaf/0x1c0 [ 33.177786] #4: 000000004dda7716 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.177795] #5: 00000000ed513e17 (console_lock){+.+.}, at: vprintk_func+0x79/0x180 [ 33.177803] [ 33.177804] stack backtrace: [ 33.177808] CPU: 1 PID: 8093 Comm: syz-executor361 Not tainted 4.19.211-syzkaller #0 [ 33.177812] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 33.177813] Call Trace: [ 33.177815] dump_stack+0x1fc/0x2ef [ 33.177818] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 33.177820] __lock_acquire+0x30c9/0x3ff0 [ 33.177822] ? mark_held_locks+0xf0/0xf0 [ 33.177824] ? snprintf+0xf0/0xf0 [ 33.177826] ? console_unlock+0x3ec/0x1110 [ 33.177828] lock_acquire+0x170/0x3c0 [ 33.177830] ? console_unlock+0x3a9/0x1110 [ 33.177832] console_unlock+0x411/0x1110 [ 33.177834] ? console_unlock+0x3a9/0x1110 [ 33.177836] vprintk_emit+0x2d1/0x740 [ 33.177838] vprintk_func+0x79/0x180 [ 33.177840] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.177842] printk+0xba/0xed [ 33.177844] ? log_store.cold+0x16/0x16 [ 33.177846] ? __lock_acquire+0x22f9/0x3ff0 [ 33.177848] ? ___ratelimit+0x319/0x590 [ 33.177850] should_fail+0x66b/0x7b0 [ 33.177852] ? setup_fault_attr+0x200/0x200 [ 33.177854] ? mark_held_locks+0xf0/0xf0 [ 33.177856] ? mark_held_locks+0xf0/0xf0 [ 33.177859] __should_failslab+0x115/0x180 [ 33.177861] should_failslab+0x5/0x10 [ 33.177862] __kmalloc+0x6d/0x3c0 [ 33.177865] ? tty_buffer_alloc+0x23f/0x2a0 [ 33.177867] tty_buffer_alloc+0x23f/0x2a0 [ 33.177869] __tty_buffer_request_room+0x156/0x2a0 [ 33.177872] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.177874] ? do_raw_spin_lock+0xcb/0x220 [ 33.177875] pty_write+0x126/0x1f0 [ 33.177878] ? trace_hardirqs_off+0x64/0x200 [ 33.177880] tty_put_char+0x122/0x150 [ 33.177882] ? dev_match_devt+0x90/0x90 [ 33.177884] ? tty_buffer_space_avail+0x7e/0xb0 [ 33.177886] ? pty_write_room+0xbe/0xe0 [ 33.177888] ? ptmx_open+0x350/0x350 [ 33.177890] __process_echoes+0x577/0x9f0 [ 33.177892] ? mark_held_locks+0xa6/0xf0 [ 33.177894] process_echoes+0xf9/0x1c0 [ 33.177896] n_tty_receive_char_special+0x8cc/0x29a0 [ 33.177899] ? n_tty_receive_buf_common+0x84/0x2a90 [ 33.177901] n_tty_receive_buf_common+0xac1/0x2a90 [ 33.177903] ? n_tty_receive_buf2+0x40/0x40 [ 33.177905] tty_ioctl+0x1026/0x1630 [ 33.177907] ? tty_fasync+0x300/0x300 [ 33.177909] ? get_pid_task+0xf4/0x190 [ 33.177911] ? proc_fail_nth_write+0x95/0x1d0 [ 33.177914] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.177916] ? debug_check_no_obj_freed+0x201/0x490 [ 33.177918] ? __vfs_write+0xff/0x770 [ 33.177920] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.177922] ? common_file_perm+0x4e5/0x850 [ 33.177924] ? tty_fasync+0x300/0x300 [ 33.177926] do_vfs_ioctl+0xcdb/0x12e0 [ 33.177928] ? vfs_write+0x3d7/0x540 [ 33.177930] ? ioctl_preallocate+0x200/0x200 [ 33.177932] ? lock_downgrade+0x720/0x720 [ 33.177935] ? check_preemption_disabled+0x41/0x280 [ 33.177937] ? vfs_write+0x393/0x540 [ 33.177939] ? ksys_write+0x1c8/0x2a0 [ 33.177941] ksys_ioctl+0x9b/0xc0 [ 33.177942] __x64_sys_ioctl+0x6f/0xb0 [ 33.177945] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.177947] do_syscall_64+0xf9/0x620 [ 33.177949] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.177951] RIP: 0033:0x7f2f9b210839 [ 33.177958] 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.177961] RSP: 002b:00007fff352436b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.177966] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f2f9b210839 [ 33.177969] RDX: 0000000020000140 RSI: 0000000000005412 RDI: 00000000