Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.142' (ECDSA) to the list of known hosts. syzkaller login: [ 32.868319] IPVS: ftp: loaded support on port[0] = 21 executing program [ 32.985160] FAULT_INJECTION: forcing a failure. [ 32.985160] name failslab, interval 1, probability 0, space 0, times 1 [ 32.997266] CPU: 0 PID: 8115 Comm: syz-executor648 Not tainted 4.19.211-syzkaller #0 [ 33.005125] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 [ 33.014455] Call Trace: [ 33.017045] dump_stack+0x1fc/0x2ef [ 33.020673] should_fail.cold+0xa/0xf [ 33.024479] ? setup_fault_attr+0x200/0x200 [ 33.028785] ? mark_held_locks+0xf0/0xf0 [ 33.032826] ? mark_held_locks+0xf0/0xf0 [ 33.036866] __should_failslab+0x115/0x180 [ 33.041098] should_failslab+0x5/0x10 [ 33.044877] __kmalloc+0x6d/0x3c0 [ 33.048321] ? tty_buffer_alloc+0x23f/0x2a0 [ 33.052638] tty_buffer_alloc+0x23f/0x2a0 [ 33.056780] __tty_buffer_request_room+0x156/0x2a0 [ 33.061688] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.067576] ? do_raw_spin_lock+0xcb/0x220 [ 33.071805] pty_write+0x126/0x1f0 [ 33.075337] tty_put_char+0x122/0x150 [ 33.079121] ? dev_match_devt+0x90/0x90 [ 33.083257] ? tty_buffer_space_avail+0x7e/0xb0 [ 33.088004] ? pty_write_room+0xbe/0xe0 [ 33.091963] ? ptmx_open+0x350/0x350 [ 33.095670] __process_echoes+0x577/0x9f0 [ 33.099798] n_tty_receive_buf_common+0xc0c/0x2a90 [ 33.104712] ? n_tty_receive_buf2+0x40/0x40 [ 33.109015] tty_ioctl+0x1026/0x1630 [ 33.112709] ? tty_fasync+0x300/0x300 [ 33.116489] ? get_pid_task+0xf4/0x190 [ 33.120379] ? proc_fail_nth_write+0x95/0x1d0 [ 33.124880] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.129787] ? debug_check_no_obj_freed+0x201/0x490 [ 33.134792] ? __vfs_write+0xff/0x770 [ 33.138578] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.143492] ? common_file_perm+0x4e5/0x850 [ 33.147818] ? tty_fasync+0x300/0x300 [ 33.151602] do_vfs_ioctl+0xcdb/0x12e0 [ 33.155472] ? vfs_write+0x3d7/0x540 [ 33.159185] ? ioctl_preallocate+0x200/0x200 [ 33.163576] ? lock_downgrade+0x720/0x720 [ 33.167710] ? check_preemption_disabled+0x41/0x280 [ 33.172714] ? vfs_write+0x393/0x540 [ 33.176409] ? ksys_write+0x1c8/0x2a0 [ 33.180194] ksys_ioctl+0x9b/0xc0 [ 33.183631] __x64_sys_ioctl+0x6f/0xb0 [ 33.187586] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.192149] do_syscall_64+0xf9/0x620 [ 33.195932] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.201104] RIP: 0033:0x7fa473839d49 [ 33.204797] Code: 28 c3 e8 1a 15 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.223681] RSP: 002b:00007ffc6228bb58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.231368] RAX: ffffffffffffffda RBX: 00007fa4738a7e50 RCX: 00007fa473839d49 [ 33.238627] RDX: 0000000020000080 RSI: 0000000000005412 RDI: 0000000000000004 [ 33.245883] RBP: 0000000000000001 R08: 0000000000000001 R09: 00007ffc6228bb88 [ 33.253134] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc6228bb70 [ 33.260390] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 33.267742] [ 33.267745] ====================================================== [ 33.267748] WARNING: possible circular locking dependency detected [ 33.267750] 4.19.211-syzkaller #0 Not tainted [ 33.267753] ------------------------------------------------------ [ 33.267756] syz-executor648/8115 is trying to acquire lock: [ 33.267757] 00000000b7e41aff (console_owner){....}, at: console_unlock+0x3a9/0x1110 [ 33.267765] [ 33.267767] but task is already holding lock: [ 33.267769] 000000007f3bd591 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.267776] [ 33.267779] which lock already depends on the new lock. [ 33.267780] [ 33.267781] [ 33.267784] the existing dependency chain (in reverse order) is: [ 33.267785] [ 33.267786] -> #2 (&(&port->lock)->rlock){-.-.}: [ 33.267793] tty_port_tty_get+0x1d/0x80 [ 33.267796] tty_port_default_wakeup+0x11/0x40 [ 33.267798] serial8250_tx_chars+0x490/0xaf0 [ 33.267800] serial8250_handle_irq.part.0+0x31f/0x3d0 [ 33.267803] serial8250_default_handle_irq+0xae/0x220 [ 33.267805] serial8250_interrupt+0x101/0x240 [ 33.267807] __handle_irq_event_percpu+0x27e/0x8e0 [ 33.267809] handle_irq_event+0x102/0x290 [ 33.267811] handle_edge_irq+0x260/0xcf0 [ 33.267813] handle_irq+0x35/0x50 [ 33.267815] do_IRQ+0x93/0x1c0 [ 33.267817] ret_from_intr+0x0/0x1e [ 33.267819] _raw_spin_unlock_irqrestore+0xa3/0xe0 [ 33.267821] uart_write+0x3bb/0x6f0 [ 33.267823] do_output_char+0x5de/0x850 [ 33.267825] n_tty_write+0x46e/0xff0 [ 33.267827] tty_write+0x496/0x810 [ 33.267829] redirected_tty_write+0xaa/0xb0 [ 33.267831] do_iter_write+0x461/0x5d0 [ 33.267833] vfs_writev+0x153/0x2e0 [ 33.267835] do_writev+0x136/0x330 [ 33.267837] do_syscall_64+0xf9/0x620 [ 33.267840] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.267841] [ 33.267842] -> #1 (&port_lock_key){-.-.}: [ 33.267849] serial8250_console_write+0x90e/0xb70 [ 33.267851] console_unlock+0xbb6/0x1110 [ 33.267853] vprintk_emit+0x2d1/0x740 [ 33.267855] vprintk_func+0x79/0x180 [ 33.267857] printk+0xba/0xed [ 33.267859] register_console+0x87f/0xc90 [ 33.267861] univ8250_console_init+0x3a/0x46 [ 33.267863] console_init+0x4cb/0x718 [ 33.267865] start_kernel+0x686/0x911 [ 33.267867] secondary_startup_64+0xa4/0xb0 [ 33.267868] [ 33.267870] -> #0 (console_owner){....}: [ 33.267877] console_unlock+0x411/0x1110 [ 33.267879] vprintk_emit+0x2d1/0x740 [ 33.267880] vprintk_func+0x79/0x180 [ 33.267882] printk+0xba/0xed [ 33.267884] should_fail+0x66b/0x7b0 [ 33.267886] __should_failslab+0x115/0x180 [ 33.267888] should_failslab+0x5/0x10 [ 33.267890] __kmalloc+0x6d/0x3c0 [ 33.267892] tty_buffer_alloc+0x23f/0x2a0 [ 33.267895] __tty_buffer_request_room+0x156/0x2a0 [ 33.267897] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.267899] pty_write+0x126/0x1f0 [ 33.267901] tty_put_char+0x122/0x150 [ 33.267903] __process_echoes+0x577/0x9f0 [ 33.267906] n_tty_receive_buf_common+0xc0c/0x2a90 [ 33.267908] tty_ioctl+0x1026/0x1630 [ 33.267910] do_vfs_ioctl+0xcdb/0x12e0 [ 33.267912] ksys_ioctl+0x9b/0xc0 [ 33.267914] __x64_sys_ioctl+0x6f/0xb0 [ 33.267915] do_syscall_64+0xf9/0x620 [ 33.267918] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.267919] [ 33.267921] other info that might help us debug this: [ 33.267922] [ 33.267924] Chain exists of: [ 33.267925] console_owner --> &port_lock_key --> &(&port->lock)->rlock [ 33.267934] [ 33.267936] Possible unsafe locking scenario: [ 33.267937] [ 33.267939] CPU0 CPU1 [ 33.267941] ---- ---- [ 33.267943] lock(&(&port->lock)->rlock); [ 33.267948] lock(&port_lock_key); [ 33.267952] lock(&(&port->lock)->rlock); [ 33.267956] lock(console_owner); [ 33.267960] [ 33.267962] *** DEADLOCK *** [ 33.267963] [ 33.267965] 6 locks held by syz-executor648/8115: [ 33.267966] #0: 00000000673828f5 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 [ 33.267975] #1: 0000000044c9810b (&port->buf.lock/1){+.+.}, at: tty_ioctl+0xfbc/0x1630 [ 33.267984] #2: 00000000597c74b9 (&o_tty->termios_rwsem/1){++++}, at: isig+0x37d/0x430 [ 33.267994] #3: 0000000034886a7d (&ldata->output_lock){+.+.}, at: n_tty_receive_buf_common+0xbce/0x2a90 [ 33.268003] #4: 000000007f3bd591 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 33.268011] #5: 000000008900ce13 (console_lock){+.+.}, at: vprintk_func+0x79/0x180 [ 33.268019] [ 33.268021] stack backtrace: [ 33.268024] CPU: 0 PID: 8115 Comm: syz-executor648 Not tainted 4.19.211-syzkaller #0 [ 33.268028] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 [ 33.268029] Call Trace: [ 33.268031] dump_stack+0x1fc/0x2ef [ 33.268034] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 33.268036] __lock_acquire+0x30c9/0x3ff0 [ 33.268038] ? mark_held_locks+0xf0/0xf0 [ 33.268040] ? snprintf+0xf0/0xf0 [ 33.268042] ? console_unlock+0x3ec/0x1110 [ 33.268044] lock_acquire+0x170/0x3c0 [ 33.268046] ? console_unlock+0x3a9/0x1110 [ 33.268048] console_unlock+0x411/0x1110 [ 33.268051] ? console_unlock+0x3a9/0x1110 [ 33.268052] vprintk_emit+0x2d1/0x740 [ 33.268054] vprintk_func+0x79/0x180 [ 33.268056] printk+0xba/0xed [ 33.268058] ? log_store.cold+0x16/0x16 [ 33.268060] ? __lock_acquire+0x22f9/0x3ff0 [ 33.268062] ? ___ratelimit+0x319/0x590 [ 33.268064] should_fail+0x66b/0x7b0 [ 33.268066] ? setup_fault_attr+0x200/0x200 [ 33.268068] ? mark_held_locks+0xf0/0xf0 [ 33.268071] ? mark_held_locks+0xf0/0xf0 [ 33.268073] __should_failslab+0x115/0x180 [ 33.268075] should_failslab+0x5/0x10 [ 33.268076] __kmalloc+0x6d/0x3c0 [ 33.268079] ? tty_buffer_alloc+0x23f/0x2a0 [ 33.268081] tty_buffer_alloc+0x23f/0x2a0 [ 33.268083] __tty_buffer_request_room+0x156/0x2a0 [ 33.268086] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 33.268088] ? do_raw_spin_lock+0xcb/0x220 [ 33.268090] pty_write+0x126/0x1f0 [ 33.268091] tty_put_char+0x122/0x150 [ 33.268093] ? dev_match_devt+0x90/0x90 [ 33.268096] ? tty_buffer_space_avail+0x7e/0xb0 [ 33.268098] ? pty_write_room+0xbe/0xe0 [ 33.268100] ? ptmx_open+0x350/0x350 [ 33.268102] __process_echoes+0x577/0x9f0 [ 33.268104] n_tty_receive_buf_common+0xc0c/0x2a90 [ 33.268106] ? n_tty_receive_buf2+0x40/0x40 [ 33.268108] tty_ioctl+0x1026/0x1630 [ 33.268110] ? tty_fasync+0x300/0x300 [ 33.268112] ? get_pid_task+0xf4/0x190 [ 33.268114] ? proc_fail_nth_write+0x95/0x1d0 [ 33.268117] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.268119] ? debug_check_no_obj_freed+0x201/0x490 [ 33.268121] ? __vfs_write+0xff/0x770 [ 33.268123] ? proc_tgid_io_accounting+0x7f0/0x7f0 [ 33.268126] ? common_file_perm+0x4e5/0x850 [ 33.268128] ? tty_fasync+0x300/0x300 [ 33.268130] do_vfs_ioctl+0xcdb/0x12e0 [ 33.268131] ? vfs_write+0x3d7/0x540 [ 33.268134] ? ioctl_preallocate+0x200/0x200 [ 33.268136] ? lock_downgrade+0x720/0x720 [ 33.268138] ? check_preemption_disabled+0x41/0x280 [ 33.268140] ? vfs_write+0x393/0x540 [ 33.268142] ? ksys_write+0x1c8/0x2a0 [ 33.268144] ksys_ioctl+0x9b/0xc0 [ 33.268146] __x64_sys_ioctl+0x6f/0xb0 [ 33.268148] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.268150] do_syscall_64+0xf9/0x620 [ 33.268152] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.268154] RIP: 0033:0x7fa473839d49 [ 33.268161] Code: 28 c3 e8 1a 15 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.268164] RSP: 002b:00007ffc6228bb58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.268169] RAX: ffffffffffffffda RBX: 00007fa4738a7e50 RCX: 00007fa473839d49 [ 33.268172] RDX: 0000000020000080 RSI: 0000000000005412 RDI: 0000000000000004 [ 33.268175] RBP: 0000000000000001 R08: 0000000000000001 R09: 00007ffc6228