Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.139' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 32.264114] FAULT_INJECTION: forcing a failure. [ 32.264114] name failslab, interval 1, probability 0, space 0, times 1 [ 32.276446] CPU: 0 PID: 8094 Comm: syz-executor185 Not tainted 4.19.211-syzkaller #0 [ 32.284317] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.293653] Call Trace: [ 32.296218] dump_stack+0x1fc/0x2ef [ 32.299822] should_fail.cold+0xa/0xf [ 32.303602] ? setup_fault_attr+0x200/0x200 [ 32.307903] ? mark_held_locks+0xf0/0xf0 [ 32.311943] __should_failslab+0x115/0x180 [ 32.316156] should_failslab+0x5/0x10 [ 32.319931] __kmalloc+0x6d/0x3c0 [ 32.323362] ? tty_buffer_alloc+0x23f/0x2a0 [ 32.327659] ? __mutex_lock+0x368/0x1190 [ 32.331715] tty_buffer_alloc+0x23f/0x2a0 [ 32.335842] __tty_buffer_request_room+0x156/0x2a0 [ 32.340750] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.346264] ? do_raw_spin_lock+0xcb/0x220 [ 32.350477] pty_write+0x126/0x1f0 [ 32.353992] ? ptmx_open+0x350/0x350 [ 32.357684] n_tty_write+0x3c0/0xff0 [ 32.361380] ? n_tty_open+0x160/0x160 [ 32.365159] ? do_wait_intr_irq+0x270/0x270 [ 32.369460] ? __might_fault+0x192/0x1d0 [ 32.373496] tty_write+0x496/0x810 [ 32.377012] ? n_tty_open+0x160/0x160 [ 32.380791] __vfs_write+0xf7/0x770 [ 32.384394] ? tty_compat_ioctl+0x270/0x270 [ 32.388695] ? common_file_perm+0x4e5/0x850 [ 32.392998] ? kernel_read+0x110/0x110 [ 32.396868] ? trace_hardirqs_off+0x64/0x200 [ 32.401253] ? apparmor_getprocattr+0x11e0/0x11e0 [ 32.406071] ? vfs_write+0x3d7/0x540 [ 32.409763] ? security_file_permission+0x1c0/0x220 [ 32.414756] vfs_write+0x1f3/0x540 [ 32.418273] ksys_write+0x12b/0x2a0 [ 32.421874] ? __ia32_sys_read+0xb0/0xb0 [ 32.425914] ? trace_hardirqs_off_caller+0x6e/0x210 [ 32.430905] ? do_syscall_64+0x21/0x620 [ 32.434856] do_syscall_64+0xf9/0x620 [ 32.438637] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.443801] RIP: 0033:0x7fd86cf59789 [ 32.447492] 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 [ 32.466368] RSP: 002b:00007ffde71218f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 32.474048] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fd86cf59789 [ 32.481292] RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 [ 32.488537] RBP: 00007ffde7121910 R08: 0000000000000001 R09: 0000000000000001 [ 32.495778] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 32.503020] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.510272] [ 32.510276] ====================================================== [ 32.510279] WARNING: possible circular locking dependency detected [ 32.510281] 4.19.211-syzkaller #0 Not tainted [ 32.510284] ------------------------------------------------------ [ 32.510286] syz-executor185/8094 is trying to acquire lock: [ 32.510288] 0000000073a247f7 (console_owner){....}, at: console_unlock+0x3a9/0x1110 [ 32.510295] [ 32.510298] but task is already holding lock: [ 32.510299] 000000008078dd67 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 32.510306] [ 32.510309] which lock already depends on the new lock. [ 32.510310] [ 32.510311] [ 32.510314] the existing dependency chain (in reverse order) is: [ 32.510315] [ 32.510316] -> #2 (&(&port->lock)->rlock){-.-.}: [ 32.510324] tty_port_tty_get+0x1d/0x80 [ 32.510326] tty_port_default_wakeup+0x11/0x40 [ 32.510328] serial8250_tx_chars+0x490/0xaf0 [ 32.510330] serial8250_handle_irq.part.0+0x31f/0x3d0 [ 32.510333] serial8250_default_handle_irq+0xae/0x220 [ 32.510335] serial8250_interrupt+0x101/0x240 [ 32.510337] __handle_irq_event_percpu+0x27e/0x8e0 [ 32.510340] handle_irq_event+0x102/0x290 [ 32.510342] handle_edge_irq+0x260/0xcf0 [ 32.510343] handle_irq+0x35/0x50 [ 32.510345] do_IRQ+0x93/0x1c0 [ 32.510347] ret_from_intr+0x0/0x1e [ 32.510349] _raw_spin_unlock_irqrestore+0xa3/0xe0 [ 32.510351] uart_write+0x3bb/0x6f0 [ 32.510353] do_output_char+0x5de/0x850 [ 32.510355] n_tty_write+0x46e/0xff0 [ 32.510357] tty_write+0x496/0x810 [ 32.510359] redirected_tty_write+0xaa/0xb0 [ 32.510361] do_iter_write+0x461/0x5d0 [ 32.510363] vfs_writev+0x153/0x2e0 [ 32.510365] do_writev+0x136/0x330 [ 32.510367] do_syscall_64+0xf9/0x620 [ 32.510370] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.510371] [ 32.510372] -> #1 (&port_lock_key){-.-.}: [ 32.510379] serial8250_console_write+0x90e/0xb70 [ 32.510381] console_unlock+0xbb6/0x1110 [ 32.510383] vprintk_emit+0x2d1/0x740 [ 32.510385] vprintk_func+0x79/0x180 [ 32.510387] printk+0xba/0xed [ 32.510389] register_console+0x87f/0xc90 [ 32.510391] univ8250_console_init+0x3a/0x46 [ 32.510393] console_init+0x4cb/0x718 [ 32.510395] start_kernel+0x686/0x911 [ 32.510397] secondary_startup_64+0xa4/0xb0 [ 32.510398] [ 32.510399] -> #0 (console_owner){....}: [ 32.510406] console_unlock+0x411/0x1110 [ 32.510408] vprintk_emit+0x2d1/0x740 [ 32.510410] vprintk_func+0x79/0x180 [ 32.510412] printk+0xba/0xed [ 32.510414] should_fail+0x66b/0x7b0 [ 32.510416] __should_failslab+0x115/0x180 [ 32.510418] should_failslab+0x5/0x10 [ 32.510420] __kmalloc+0x6d/0x3c0 [ 32.510422] tty_buffer_alloc+0x23f/0x2a0 [ 32.510425] __tty_buffer_request_room+0x156/0x2a0 [ 32.510427] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.510429] pty_write+0x126/0x1f0 [ 32.510431] n_tty_write+0x3c0/0xff0 [ 32.510433] tty_write+0x496/0x810 [ 32.510435] __vfs_write+0xf7/0x770 [ 32.510437] vfs_write+0x1f3/0x540 [ 32.510439] ksys_write+0x12b/0x2a0 [ 32.510441] do_syscall_64+0xf9/0x620 [ 32.510443] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.510444] [ 32.510447] other info that might help us debug this: [ 32.510448] [ 32.510449] Chain exists of: [ 32.510450] console_owner --> &port_lock_key --> &(&port->lock)->rlock [ 32.510459] [ 32.510461] Possible unsafe locking scenario: [ 32.510463] [ 32.510465] CPU0 CPU1 [ 32.510467] ---- ---- [ 32.510468] lock(&(&port->lock)->rlock); [ 32.510473] lock(&port_lock_key); [ 32.510478] lock(&(&port->lock)->rlock); [ 32.510482] lock(console_owner); [ 32.510486] [ 32.510487] *** DEADLOCK *** [ 32.510488] [ 32.510491] 6 locks held by syz-executor185/8094: [ 32.510492] #0: 0000000051498902 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 [ 32.510500] #1: 000000004e9d92c7 (&tty->atomic_write_lock){+.+.}, at: tty_write+0x24e/0x810 [ 32.510509] #2: 00000000b45cf2c4 (&o_tty->termios_rwsem/1){++++}, at: n_tty_write+0x1b5/0xff0 [ 32.510518] #3: 0000000071f8e732 (&ldata->output_lock){+.+.}, at: n_tty_write+0x4e3/0xff0 [ 32.510527] #4: 000000008078dd67 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 32.510535] #5: 000000001c2120a7 (console_lock){+.+.}, at: vprintk_func+0x79/0x180 [ 32.510543] [ 32.510545] stack backtrace: [ 32.510548] CPU: 0 PID: 8094 Comm: syz-executor185 Not tainted 4.19.211-syzkaller #0 [ 32.510552] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.510554] Call Trace: [ 32.510556] dump_stack+0x1fc/0x2ef [ 32.510558] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 32.510560] __lock_acquire+0x30c9/0x3ff0 [ 32.510562] ? mark_held_locks+0xf0/0xf0 [ 32.510564] ? snprintf+0xf0/0xf0 [ 32.510566] ? console_unlock+0x3ec/0x1110 [ 32.510569] lock_acquire+0x170/0x3c0 [ 32.510571] ? console_unlock+0x3a9/0x1110 [ 32.510573] console_unlock+0x411/0x1110 [ 32.510575] ? console_unlock+0x3a9/0x1110 [ 32.510577] vprintk_emit+0x2d1/0x740 [ 32.510579] vprintk_func+0x79/0x180 [ 32.510580] printk+0xba/0xed [ 32.510582] ? log_store.cold+0x16/0x16 [ 32.510585] ? __lock_acquire+0x22f9/0x3ff0 [ 32.510587] ? ___ratelimit+0x319/0x590 [ 32.510588] should_fail+0x66b/0x7b0 [ 32.510591] ? setup_fault_attr+0x200/0x200 [ 32.510593] ? mark_held_locks+0xf0/0xf0 [ 32.510595] __should_failslab+0x115/0x180 [ 32.510597] should_failslab+0x5/0x10 [ 32.510599] __kmalloc+0x6d/0x3c0 [ 32.510601] ? tty_buffer_alloc+0x23f/0x2a0 [ 32.510603] ? __mutex_lock+0x368/0x1190 [ 32.510605] tty_buffer_alloc+0x23f/0x2a0 [ 32.510607] __tty_buffer_request_room+0x156/0x2a0 [ 32.510610] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.510612] ? do_raw_spin_lock+0xcb/0x220 [ 32.510614] pty_write+0x126/0x1f0 [ 32.510616] ? ptmx_open+0x350/0x350 [ 32.510618] n_tty_write+0x3c0/0xff0 [ 32.510620] ? n_tty_open+0x160/0x160 [ 32.510622] ? do_wait_intr_irq+0x270/0x270 [ 32.510624] ? __might_fault+0x192/0x1d0 [ 32.510626] tty_write+0x496/0x810 [ 32.510628] ? n_tty_open+0x160/0x160 [ 32.510629] __vfs_write+0xf7/0x770 [ 32.510632] ? tty_compat_ioctl+0x270/0x270 [ 32.510634] ? common_file_perm+0x4e5/0x850 [ 32.510636] ? kernel_read+0x110/0x110 [ 32.510638] ? trace_hardirqs_off+0x64/0x200 [ 32.510640] ? apparmor_getprocattr+0x11e0/0x11e0 [ 32.510642] ? vfs_write+0x3d7/0x540 [ 32.510644] ? security_file_permission+0x1c0/0x220 [ 32.510646] vfs_write+0x1f3/0x540 [ 32.510648] ksys_write+0x12b/0x2a0 [ 32.510650] ? __ia32_sys_read+0xb0/0xb0 [ 32.510653] ? trace_hardirqs_off_caller+0x6e/0x210 [ 32.510655] ? do_syscall_64+0x21/0x620 [ 32.510657] do_syscall_64+0xf9/0x620 [ 32.510659] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.510661] RIP: 0033:0x7fd86cf59789 [ 32.510668] 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 [ 32.510670] RSP: 002b:00007ffde71218f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 32.510676] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fd86cf59789 [ 32.510679] RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 [ 32.510682] RBP: 00007ffde7121910 R08: 0000000000000001 R09: 0000000000000001 [ 32.510685] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 32.510688] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000