Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.197' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 32.336059] FAULT_INJECTION: forcing a failure. [ 32.336059] name failslab, interval 1, probability 0, space 0, times 1 [ 32.348386] CPU: 1 PID: 8115 Comm: syz-executor151 Not tainted 4.19.211-syzkaller #0 [ 32.356243] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.365573] Call Trace: [ 32.368143] dump_stack+0x1fc/0x2ef [ 32.371750] should_fail.cold+0xa/0xf [ 32.375533] ? setup_fault_attr+0x200/0x200 [ 32.379835] ? mark_held_locks+0xf0/0xf0 [ 32.383875] ? lock_acquire+0x170/0x3c0 [ 32.387827] __should_failslab+0x115/0x180 [ 32.392042] should_failslab+0x5/0x10 [ 32.395825] __kmalloc+0x6d/0x3c0 [ 32.399256] ? tty_buffer_alloc+0x23f/0x2a0 [ 32.403555] ? __mutex_lock+0x368/0x1190 [ 32.407593] tty_buffer_alloc+0x23f/0x2a0 [ 32.411720] __tty_buffer_request_room+0x156/0x2a0 [ 32.416630] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.422145] ? do_raw_spin_lock+0xcb/0x220 [ 32.426360] pty_write+0x126/0x1f0 [ 32.429877] ? ptmx_open+0x350/0x350 [ 32.433571] n_tty_write+0x3c0/0xff0 [ 32.437265] ? n_tty_open+0x160/0x160 [ 32.441044] ? do_wait_intr_irq+0x270/0x270 [ 32.445344] ? __might_fault+0x192/0x1d0 [ 32.449387] tty_write+0x496/0x810 [ 32.452906] ? n_tty_open+0x160/0x160 [ 32.456689] __vfs_write+0xf7/0x770 [ 32.460294] ? tty_compat_ioctl+0x270/0x270 [ 32.464595] ? common_file_perm+0x4e5/0x850 [ 32.468892] ? kernel_read+0x110/0x110 [ 32.472759] ? trace_hardirqs_off+0x64/0x200 [ 32.477146] ? apparmor_getprocattr+0x11e0/0x11e0 [ 32.481972] ? vfs_write+0x3d7/0x540 [ 32.485667] ? security_file_permission+0x1c0/0x220 [ 32.490661] vfs_write+0x1f3/0x540 [ 32.494181] ksys_write+0x12b/0x2a0 [ 32.497786] ? __ia32_sys_read+0xb0/0xb0 [ 32.501827] ? trace_hardirqs_off_caller+0x6e/0x210 [ 32.506822] ? do_syscall_64+0x21/0x620 [ 32.510771] do_syscall_64+0xf9/0x620 [ 32.514555] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.519722] RIP: 0033:0x7f547abe67a9 [ 32.523411] 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.542289] RSP: 002b:00007ffcd63bcbc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 32.549974] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f547abe67a9 [ 32.557221] RDX: 00000000fffffdc9 RSI: 0000000020000000 RDI: 0000000000000004 [ 32.564468] RBP: 00007ffcd63bcbe0 R08: 0000000000000001 R09: 0000000000000001 [ 32.571715] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 32.578980] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.586257] [ 32.586260] ====================================================== [ 32.586263] WARNING: possible circular locking dependency detected [ 32.586265] 4.19.211-syzkaller #0 Not tainted [ 32.586268] ------------------------------------------------------ [ 32.586271] syz-executor151/8115 is trying to acquire lock: [ 32.586273] 000000009fae633d (console_owner){....}, at: console_unlock+0x3a9/0x1110 [ 32.586280] [ 32.586282] but task is already holding lock: [ 32.586284] 00000000d59b2953 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 32.586291] [ 32.586294] which lock already depends on the new lock. [ 32.586295] [ 32.586296] [ 32.586299] the existing dependency chain (in reverse order) is: [ 32.586300] [ 32.586301] -> #2 (&(&port->lock)->rlock){-.-.}: [ 32.586308] tty_port_tty_get+0x1d/0x80 [ 32.586311] tty_port_default_wakeup+0x11/0x40 [ 32.586313] serial8250_tx_chars+0x490/0xaf0 [ 32.586315] serial8250_handle_irq.part.0+0x31f/0x3d0 [ 32.586318] serial8250_default_handle_irq+0xae/0x220 [ 32.586320] serial8250_interrupt+0x101/0x240 [ 32.586322] __handle_irq_event_percpu+0x27e/0x8e0 [ 32.586324] handle_irq_event+0x102/0x290 [ 32.586326] handle_edge_irq+0x260/0xcf0 [ 32.586328] handle_irq+0x35/0x50 [ 32.586330] do_IRQ+0x93/0x1c0 [ 32.586332] ret_from_intr+0x0/0x1e [ 32.586334] _raw_spin_unlock_irqrestore+0xa3/0xe0 [ 32.586336] uart_write+0x3bb/0x6f0 [ 32.586338] do_output_char+0x5de/0x850 [ 32.586340] n_tty_write+0x46e/0xff0 [ 32.586342] tty_write+0x496/0x810 [ 32.586344] redirected_tty_write+0xaa/0xb0 [ 32.586346] do_iter_write+0x461/0x5d0 [ 32.586348] vfs_writev+0x153/0x2e0 [ 32.586350] do_writev+0x136/0x330 [ 32.586352] do_syscall_64+0xf9/0x620 [ 32.586355] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.586356] [ 32.586357] -> #1 (&port_lock_key){-.-.}: [ 32.586364] serial8250_console_write+0x90e/0xb70 [ 32.586366] console_unlock+0xbb6/0x1110 [ 32.586368] vprintk_emit+0x2d1/0x740 [ 32.586370] vprintk_func+0x79/0x180 [ 32.586372] printk+0xba/0xed [ 32.586374] register_console+0x87f/0xc90 [ 32.586376] univ8250_console_init+0x3a/0x46 [ 32.586378] console_init+0x4cb/0x718 [ 32.586380] start_kernel+0x686/0x911 [ 32.586382] secondary_startup_64+0xa4/0xb0 [ 32.586383] [ 32.586384] -> #0 (console_owner){....}: [ 32.586391] console_unlock+0x411/0x1110 [ 32.586393] vprintk_emit+0x2d1/0x740 [ 32.586395] vprintk_func+0x79/0x180 [ 32.586397] printk+0xba/0xed [ 32.586399] should_fail+0x66b/0x7b0 [ 32.586401] __should_failslab+0x115/0x180 [ 32.586403] should_failslab+0x5/0x10 [ 32.586405] __kmalloc+0x6d/0x3c0 [ 32.586407] tty_buffer_alloc+0x23f/0x2a0 [ 32.586410] __tty_buffer_request_room+0x156/0x2a0 [ 32.586412] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.586414] pty_write+0x126/0x1f0 [ 32.586416] n_tty_write+0x3c0/0xff0 [ 32.586418] tty_write+0x496/0x810 [ 32.586420] __vfs_write+0xf7/0x770 [ 32.586422] vfs_write+0x1f3/0x540 [ 32.586424] ksys_write+0x12b/0x2a0 [ 32.586426] do_syscall_64+0xf9/0x620 [ 32.586428] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.586429] [ 32.586432] other info that might help us debug this: [ 32.586433] [ 32.586434] Chain exists of: [ 32.586435] console_owner --> &port_lock_key --> &(&port->lock)->rlock [ 32.586444] [ 32.586446] Possible unsafe locking scenario: [ 32.586448] [ 32.586450] CPU0 CPU1 [ 32.586452] ---- ---- [ 32.586453] lock(&(&port->lock)->rlock); [ 32.586458] lock(&port_lock_key); [ 32.586463] lock(&(&port->lock)->rlock); [ 32.586467] lock(console_owner); [ 32.586470] [ 32.586472] *** DEADLOCK *** [ 32.586473] [ 32.586475] 6 locks held by syz-executor151/8115: [ 32.586477] #0: 000000004852d7b8 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 [ 32.586485] #1: 00000000ac6c59be (&tty->atomic_write_lock){+.+.}, at: tty_write+0x24e/0x810 [ 32.586494] #2: 0000000058457c9e (&o_tty->termios_rwsem/1){++++}, at: n_tty_write+0x1b5/0xff0 [ 32.586503] #3: 000000006ef64279 (&ldata->output_lock){+.+.}, at: n_tty_write+0x4e3/0xff0 [ 32.586512] #4: 00000000d59b2953 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf4/0x1f0 [ 32.586520] #5: 00000000200a71ab (console_lock){+.+.}, at: vprintk_func+0x79/0x180 [ 32.586528] [ 32.586530] stack backtrace: [ 32.586533] CPU: 1 PID: 8115 Comm: syz-executor151 Not tainted 4.19.211-syzkaller #0 [ 32.586537] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.586539] Call Trace: [ 32.586540] dump_stack+0x1fc/0x2ef [ 32.586543] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 32.586545] __lock_acquire+0x30c9/0x3ff0 [ 32.586547] ? mark_held_locks+0xf0/0xf0 [ 32.586549] ? snprintf+0xf0/0xf0 [ 32.586551] ? console_unlock+0x3ec/0x1110 [ 32.586553] lock_acquire+0x170/0x3c0 [ 32.586555] ? console_unlock+0x3a9/0x1110 [ 32.586557] console_unlock+0x411/0x1110 [ 32.586559] ? console_unlock+0x3a9/0x1110 [ 32.586561] vprintk_emit+0x2d1/0x740 [ 32.586563] vprintk_func+0x79/0x180 [ 32.586565] printk+0xba/0xed [ 32.586567] ? log_store.cold+0x16/0x16 [ 32.586569] ? try_to_wake_up+0x733/0x1050 [ 32.586571] ? __lock_acquire+0x6de/0x3ff0 [ 32.586573] ? ___ratelimit+0x319/0x590 [ 32.586575] should_fail+0x66b/0x7b0 [ 32.586577] ? setup_fault_attr+0x200/0x200 [ 32.586579] ? mark_held_locks+0xf0/0xf0 [ 32.586581] ? lock_acquire+0x170/0x3c0 [ 32.586584] __should_failslab+0x115/0x180 [ 32.586586] should_failslab+0x5/0x10 [ 32.586588] __kmalloc+0x6d/0x3c0 [ 32.586590] ? tty_buffer_alloc+0x23f/0x2a0 [ 32.586592] ? __mutex_lock+0x368/0x1190 [ 32.586594] tty_buffer_alloc+0x23f/0x2a0 [ 32.586596] __tty_buffer_request_room+0x156/0x2a0 [ 32.586599] tty_insert_flip_string_fixed_flag+0x93/0x250 [ 32.586601] ? do_raw_spin_lock+0xcb/0x220 [ 32.586603] pty_write+0x126/0x1f0 [ 32.586605] ? ptmx_open+0x350/0x350 [ 32.586607] n_tty_write+0x3c0/0xff0 [ 32.586609] ? n_tty_open+0x160/0x160 [ 32.586611] ? do_wait_intr_irq+0x270/0x270 [ 32.586613] ? __might_fault+0x192/0x1d0 [ 32.586615] tty_write+0x496/0x810 [ 32.586617] ? n_tty_open+0x160/0x160 [ 32.586618] __vfs_write+0xf7/0x770 [ 32.586621] ? tty_compat_ioctl+0x270/0x270 [ 32.586623] ? common_file_perm+0x4e5/0x850 [ 32.586625] ? kernel_read+0x110/0x110 [ 32.586627] ? trace_hardirqs_off+0x64/0x200 [ 32.586629] ? apparmor_getprocattr+0x11e0/0x11e0 [ 32.586631] ? vfs_write+0x3d7/0x540 [ 32.586633] ? security_file_permission+0x1c0/0x220 [ 32.586635] vfs_write+0x1f3/0x540 [ 32.586637] ksys_write+0x12b/0x2a0 [ 32.586639] ? __ia32_sys_read+0xb0/0xb0 [ 32.586642] ? trace_hardirqs_off_caller+0x6e/0x210 [ 32.586644] ? do_syscall_64+0x21/0x620 [ 32.586646] do_syscall_64+0xf9/0x620 [ 32.586648] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.586650] RIP: 0033:0x7f547abe67a9 [ 32.586657] 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.586659] RSP: 002b:00007ffcd63bcbc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 32.586665] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f547abe67a9 [ 32.586668] RDX: 00000000fffffdc9 RSI: 0000000020000000 RDI: 0000000000000004 [ 32.586671] RBP: 00007ffcd63bcbe0 R08: 0000000000000001 R09: 0000000000000001 [ 32.586674] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 [ 32.586677] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000