syzbot


possible deadlock in uart_write

Status: upstream: reported C repro on 2020/02/04 05:05
Reported-by: syzbot+23b746f27f5e2f9fb1e8@syzkaller.appspotmail.com
First crash: 883d, last: 9h42m
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in uart_write C done unreliable 609 199d 922d 0/22 upstream: reported C repro on 2019/12/26 21:25
linux-4.14 possible deadlock in uart_write C error 343 8d11h 892d 0/1 upstream: reported C repro on 2020/01/26 11:10

Sample crash report:
============================================
WARNING: possible recursive locking detected
4.19.107-syzkaller #0 Not tainted
--------------------------------------------
swapper/0/0 is trying to acquire lock:
000000006e09c358 (&port_lock_key){-.-.}, at: uart_write+0x1c7/0x680 drivers/tty/serial/serial_core.c:591

but task is already holding lock:
000000006e09c358 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x290 drivers/tty/serial/8250/8250_port.c:1868

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&port_lock_key);
  lock(&port_lock_key);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by swapper/0/0:
 #0: 00000000c9092b7b (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline]
 #0: 00000000c9092b7b (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x2b/0x1d0 drivers/tty/serial/8250/8250_core.c:115
 #1: 000000006e09c358 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x290 drivers/tty/serial/8250/8250_port.c:1868
 #2: 000000005a7ebb69 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.107-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:1759 [inline]
 check_deadlock kernel/locking/lockdep.c:1803 [inline]
 validate_chain kernel/locking/lockdep.c:2399 [inline]
 __lock_acquire.cold+0x20f/0x4a7 kernel/locking/lockdep.c:3411
 lock_acquire+0x170/0x400 kernel/locking/lockdep.c:3903
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xbf kernel/locking/spinlock.c:152
 uart_write+0x1c7/0x680 drivers/tty/serial/serial_core.c:591
 n_hdlc_send_frames+0x276/0x450 drivers/tty/n_hdlc.c:403
 n_hdlc_tty_wakeup+0xa0/0xc0 drivers/tty/n_hdlc.c:479
 tty_wakeup+0xd4/0x110 drivers/tty/tty_io.c:534
 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:50
 serial8250_tx_chars+0x48f/0xae0 drivers/tty/serial/8250/8250_port.c:1806
 serial8250_handle_irq.part.0+0x24b/0x290 drivers/tty/serial/8250/8250_port.c:1879
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1865 [inline]
 serial8250_default_handle_irq+0xb5/0x140 drivers/tty/serial/8250/8250_port.c:1895
 serial8250_interrupt+0xf2/0x1d0 drivers/tty/serial/8250/8250_core.c:125
 __handle_irq_event_percpu+0x144/0x8e0 kernel/irq/handle.c:149
 handle_irq_event_percpu+0x76/0x160 kernel/irq/handle.c:189
 handle_irq_event+0xa2/0x12d kernel/irq/handle.c:206
 handle_edge_irq+0x24b/0x8c0 kernel/irq/chip.c:797
 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline]
 handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87
 do_IRQ+0x93/0x1c0 arch/x86/kernel/irq.c:246
 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:670
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: fa eb 82 90 90 90 90 90 90 90 90 90 e9 07 00 00 00 0f 00 2d f4 02 48 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d e4 02 48 00 fb f4 <c3> 90 41 56 41 55 41 54 55 53 e8 23 c2 36 fa e8 ce ce 35 fc 0f 1f
RSP: 0018:ffffffff88a07d40 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffd5
RAX: 1ffffffff1164ad4 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffffffff88a7a73c
RBP: 0000000000000000 R08: ffffffff88a79ec0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff88b25690
R13: 0000000000000000 R14: 0000000000000000 R15: ffffffff88a79ec0
 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline]
 default_idle+0x49/0x320 arch/x86/kernel/process.c:565
 cpuidle_idle_call kernel/sched/idle.c:153 [inline]
 do_idle+0x2ee/0x4b0 kernel/sched/idle.c:263
 cpu_startup_entry+0xc6/0xd0 kernel/sched/idle.c:369
 start_kernel+0x7e4/0x81c init/main.c:737
 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

Crashes (735):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2020/03/02 03:52 linux-4.19.y a083db76118d 4a4e0509 .config log report syz C
ci2-linux-4-19 2020/03/01 20:59 linux-4.19.y a083db76118d c88c7b75 .config log report syz C
ci2-linux-4-19 2022/07/06 02:56 linux-4.19.y 3f8a27f9e27b bff65f44 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/07/05 15:45 linux-4.19.y 3f8a27f9e27b bff65f44 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/07/03 13:21 linux-4.19.y 3f8a27f9e27b 1434eec0 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/07/02 11:06 linux-4.19.y 3f8a27f9e27b 1434eec0 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/26 12:35 linux-4.19.y 3f8a27f9e27b a371c43c .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/20 02:38 linux-4.19.y 3f8a27f9e27b 8f633d84 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/18 04:42 linux-4.19.y 3f8a27f9e27b 8f633d84 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/16 16:47 linux-4.19.y 3f8a27f9e27b 1719ee24 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/15 13:12 linux-4.19.y 3f8a27f9e27b 1719ee24 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/14 02:07 linux-4.19.y 3f8a27f9e27b 0f087040 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/06/04 15:19 linux-4.19.y 3f8a27f9e27b c8857892 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/31 04:17 linux-4.19.y 3f8a27f9e27b af70c3a9 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/30 11:09 linux-4.19.y 3f8a27f9e27b a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/28 21:55 linux-4.19.y 3f8a27f9e27b a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/28 21:35 linux-4.19.y 3f8a27f9e27b a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/28 16:16 linux-4.19.y 3f8a27f9e27b a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/28 06:06 linux-4.19.y 3f8a27f9e27b a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/27 16:53 linux-4.19.y 3f8a27f9e27b 116e7a7b .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/26 21:29 linux-4.19.y 3f8a27f9e27b 3037caa9 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/22 13:38 linux-4.19.y 3f8a27f9e27b 7268fa62 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/18 23:22 linux-4.19.y 3f8a27f9e27b 50c53f39 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/18 21:11 linux-4.19.y 3f8a27f9e27b 50c53f39 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/17 13:02 linux-4.19.y 3f8a27f9e27b 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/17 01:00 linux-4.19.y 3f8a27f9e27b 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/15 19:00 linux-4.19.y 3f8a27f9e27b 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/15 10:27 linux-4.19.y 3f8a27f9e27b 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/12 15:13 linux-4.19.y 3f8a27f9e27b 9ad6612a .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/11 09:50 linux-4.19.y 3f8a27f9e27b 8d7b3b67 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/10 07:51 linux-4.19.y 3f8a27f9e27b 8b277b8e .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/05 13:06 linux-4.19.y 3f8a27f9e27b b3f09415 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/05 07:25 linux-4.19.y 3f8a27f9e27b dc9e5259 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/03 12:55 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/02 21:46 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/02 19:34 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/05/01 08:32 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/29 21:59 linux-4.19.y 3f8a27f9e27b 44a5ca63 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/29 02:12 linux-4.19.y 3f8a27f9e27b e9076525 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/22 18:56 linux-4.19.y 3f8a27f9e27b 131df97d .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/22 06:55 linux-4.19.y 3f8a27f9e27b 2738b391 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/22 00:41 linux-4.19.y 3f8a27f9e27b 2738b391 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/18 09:27 linux-4.19.y 3f8a27f9e27b 8bcc32a6 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/13 03:01 linux-4.19.y 3f8a27f9e27b dacb3f1c .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/12 13:33 linux-4.19.y 3f8a27f9e27b af01ee7d .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/09 04:17 linux-4.19.y 3f8a27f9e27b e22c3da3 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/07 23:47 linux-4.19.y 3f8a27f9e27b c6ff3e05 .config log report info possible deadlock in uart_write
ci2-linux-4-19 2022/04/05 12:32 linux-4.19.y 3f8a27f9e27b 5915c2cb .config log report info possible deadlock in uart_write
ci2-linux-4-19 2021/01/09 17:27 linux-4.19.y 610bdbf6a174 a6c52263 .config log report info
ci2-linux-4-19 2020/02/04 05:04 linux-4.19.y 32ee7492f104 93e5e335 .config log report