syzbot


possible deadlock in uart_write

Status: upstream: reported C repro on 2020/01/26 11:10
Reported-by: syzbot+5d27dc5bbf29770820f1@syzkaller.appspotmail.com
First crash: 891d, last: 8d00h

Fix bisection: failed (bisect log)
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.19 possible deadlock in uart_write C 734 10h02m 882d 0/1 upstream: reported C repro on 2020/02/04 05:05

Sample crash report:
============================================
WARNING: possible recursive locking detected
4.14.279-syzkaller #0 Not tainted
--------------------------------------------
swapper/1/0 is trying to acquire lock:
 (&port_lock_key){-.-.}, at: [<ffffffff835a4ea9>] uart_write+0x109/0x560 drivers/tty/serial/serial_core.c:611

but task is already holding lock:
 (&port_lock_key){-.-.}, at: [<ffffffff835c0260>] serial8250_handle_irq.part.0+0x20/0x330 drivers/tty/serial/8250/8250_port.c:1889

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/1/0:
 #0:  (&(&i->lock)->rlock){-.-.}, at: [<ffffffff835ad6ca>] spin_lock include/linux/spinlock.h:317 [inline]
 #0:  (&(&i->lock)->rlock){-.-.}, at: [<ffffffff835ad6ca>] serial8250_interrupt+0x3a/0x210 drivers/tty/serial/8250/8250_core.c:119
 #1:  (&port_lock_key){-.-.}, at: [<ffffffff835c0260>] serial8250_handle_irq.part.0+0x20/0x330 drivers/tty/serial/8250/8250_port.c:1889
 #2:  (&tty->ldisc_sem){++++}, at: [<ffffffff8355257b>] tty_ldisc_ref+0x1b/0x80 drivers/tty/tty_ldisc.c:305

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.14.279-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:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_deadlock_bug kernel/locking/lockdep.c:1800 [inline]
 check_deadlock kernel/locking/lockdep.c:1847 [inline]
 validate_chain kernel/locking/lockdep.c:2448 [inline]
 __lock_acquire.cold+0x180/0x97c kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160
 uart_write+0x109/0x560 drivers/tty/serial/serial_core.c:611
 n_hdlc_send_frames+0x241/0x410 drivers/tty/n_hdlc.c:404
 n_hdlc_tty_wakeup+0x95/0xb0 drivers/tty/n_hdlc.c:480
 tty_wakeup+0xc3/0xf0 drivers/tty/tty_io.c:533
 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:49
 serial8250_tx_chars+0x3fe/0xbe0 drivers/tty/serial/8250/8250_port.c:1826
 serial8250_handle_irq.part.0+0x28d/0x330 drivers/tty/serial/8250/8250_port.c:1913
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1886 [inline]
 serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1929
 serial8250_interrupt+0xf3/0x210 drivers/tty/serial/8250/8250_core.c:129
 __handle_irq_event_percpu+0xee/0x7f0 kernel/irq/handle.c:147
 handle_irq_event_percpu kernel/irq/handle.c:187 [inline]
 handle_irq_event+0xf0/0x250 kernel/irq/handle.c:204
 handle_edge_irq+0x224/0xc40 kernel/irq/chip.c:770
 generic_handle_irq_desc include/linux/irqdesc.h:159 [inline]
 handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87
 do_IRQ+0x93/0x1d0 arch/x86/kernel/irq.c:230
 common_interrupt+0x93/0x93 arch/x86/entry/entry_64.S:576
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
RSP: 0018:ffff8880b5487e68 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffc8
RAX: 1ffffffff11e1314 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880b5478bc4
RBP: ffffffff88f09890 R08: ffffffff88cc9d68 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffed1016a8f068
R13: ffff8880b5478340 R14: 0000000000000000 R15: 0000000000000000
 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline]
 default_idle+0x47/0x370 arch/x86/kernel/process.c:558
 cpuidle_idle_call kernel/sched/idle.c:156 [inline]
 do_idle+0x250/0x3c0 kernel/sched/idle.c:246
 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:351
 start_secondary+0x4db/0x670 arch/x86/kernel/smpboot.c:272
 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240

Crashes (343):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2022/05/15 23:50 linux-4.14.y 690285a9380d 744a39e2 .config log report syz C possible deadlock in uart_write
ci2-linux-4-14 2020/03/06 06:46 linux-4.14.y 78d697fc93f9 b655d91b .config log report syz C
ci2-linux-4-14 2020/03/01 20:56 linux-4.14.y 78d697fc93f9 c88c7b75 .config log report syz C
ci2-linux-4-14 2022/06/28 01:11 linux-4.14.y f051383ef03b ef82eb2c .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/06/16 12:46 linux-4.14.y 84bae26850e3 1719ee24 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/06/04 15:33 linux-4.14.y 501eec4f9e13 c8857892 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/06/03 17:09 linux-4.14.y 501eec4f9e13 eee80d3c .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/06/02 22:51 linux-4.14.y 501eec4f9e13 02dddea8 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/06/02 12:33 linux-4.14.y 501eec4f9e13 6e12f05f .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/28 21:42 linux-4.14.y 501eec4f9e13 a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/28 05:28 linux-4.14.y 501eec4f9e13 a46af346 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/27 11:40 linux-4.14.y 501eec4f9e13 116e7a7b .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/25 10:11 linux-4.14.y 501eec4f9e13 647c0e27 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/17 13:05 linux-4.14.y 690285a9380d 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/15 23:26 linux-4.14.y 690285a9380d 744a39e2 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/07 04:36 linux-4.14.y e3a56aaade89 e60b1103 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/04 21:55 linux-4.14.y e3a56aaade89 dc9e5259 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/05/03 02:27 linux-4.14.y e3a56aaade89 2df221f6 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/22 22:05 linux-4.14.y 15a1c6b6f516 131df97d .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/22 06:58 linux-4.14.y 15a1c6b6f516 2738b391 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/16 14:04 linux-4.14.y 74766a973637 8bcc32a6 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/13 09:29 linux-4.14.y 74766a973637 faabdb86 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/12 19:28 linux-4.14.y 74766a973637 dacb3f1c .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/04/04 15:09 linux-4.14.y 74766a973637 5915c2cb .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/03/04 00:12 linux-4.14.y e853993d29aa 45a13a73 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/03/02 15:23 linux-4.14.y e853993d29aa 45a13a73 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/02/26 01:58 linux-4.14.y fa33f9094f36 45a13a73 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/31 03:38 linux-4.14.y b86ee2b7ae42 495e00c5 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/22 10:57 linux-4.14.y 4ba8e26127c3 214351e1 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/19 14:35 linux-4.14.y 4ba8e26127c3 0620189b .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/19 11:52 linux-4.14.y 4ba8e26127c3 0620189b .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/18 18:14 linux-4.14.y 4ba8e26127c3 731a2d23 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/18 14:47 linux-4.14.y 4ba8e26127c3 731a2d23 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/18 13:02 linux-4.14.y 4ba8e26127c3 731a2d23 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/18 04:43 linux-4.14.y 4ba8e26127c3 731a2d23 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/17 10:48 linux-4.14.y 4ba8e26127c3 731a2d23 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/16 15:06 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/16 05:06 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/16 03:50 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/15 16:24 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/15 14:21 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/15 03:02 linux-4.14.y 4ba8e26127c3 723cfaf0 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/13 04:17 linux-4.14.y 4ba8e26127c3 44d1319a .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/11 15:31 linux-4.14.y 4ba8e26127c3 1884f55a .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/11 12:40 linux-4.14.y bfdef05c8da4 1884f55a .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/11 09:21 linux-4.14.y bfdef05c8da4 1884f55a .config log report info possible deadlock in uart_write
ci2-linux-4-14 2022/01/10 15:30 linux-4.14.y bfdef05c8da4 2ca0d385 .config log report info possible deadlock in uart_write
ci2-linux-4-14 2021/01/14 16:46 linux-4.14.y f79dc86058bc 468dbb55 .config log report info
ci2-linux-4-14 2020/01/26 11:09 linux-4.14.y 8bac50406cca f4e7270e .config log report