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: 1782d, last: 663d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in uart_write serial C done unreliable 609 1098d 1821d 0/28 auto-obsoleted due to no activity on 2022/10/21 10:26
linux-4.14 possible deadlock in uart_write C error 394 668d 1791d 0/1 upstream: reported C repro on 2020/01/26 11:10
upstream possible deadlock in uart_write (2) serial C 68 184d 240d 0/28 auto-obsoleted due to no activity on 2024/08/29 00:55

Sample crash report:
IPVS: ftp: loaded support on port[0] = 21
============================================
WARNING: possible recursive locking detected
4.19.211-syzkaller #0 Not tainted
--------------------------------------------
swapper/1/0 is trying to acquire lock:
000000005a4695cc (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591

but task is already holding lock:
000000005a4695cc (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876

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: 0000000088525b6d (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline]
 #0: 0000000088525b6d (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115
 #1: 000000005a4695cc (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876
 #2: 00000000f5223691 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:1764 [inline]
 check_deadlock kernel/locking/lockdep.c:1808 [inline]
 validate_chain kernel/locking/lockdep.c:2404 [inline]
 __lock_acquire.cold+0x121/0x57e kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:152
 uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591
 n_hdlc_send_frames+0x278/0x470 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+0x490/0xaf0 drivers/tty/serial/8250/8250_port.c:1813
 serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1900
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1873 [inline]
 serial8250_default_handle_irq+0xae/0x220 drivers/tty/serial/8250/8250_port.c:1916
 serial8250_interrupt+0x101/0x240 drivers/tty/serial/8250/8250_core.c:125
 __handle_irq_event_percpu+0x27e/0x8e0 kernel/irq/handle.c:149
 handle_irq_event_percpu kernel/irq/handle.c:189 [inline]
 handle_irq_event+0x102/0x290 kernel/irq/handle.c:206
 handle_edge_irq+0x260/0xcf0 kernel/irq/chip.c:800
 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: 48 89 df e8 f4 20 7f f9 e9 2e ff ff ff 48 89 df e8 e7 20 7f f9 eb 82 90 90 90 90 90 e9 07 00 00 00 0f 00 2d 14 43 4e 00 fb f4 <c3> 90 e9 07 00 00 00 0f 00 2d 04 43 4e 00 f4 c3 90 90 41 56 41 55
RSP: 0018:ffff8880b5a9fd40 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffd2
RAX: 1ffffffff13e3054 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880b5a86c44
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff89f18290
R13: 1ffff11016b53fb2 R14: 0000000000000000 R15: 0000000000000000
 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline]
 default_idle+0x49/0x310 arch/x86/kernel/process.c:557
 cpuidle_idle_call kernel/sched/idle.c:153 [inline]
 do_idle+0x2ec/0x4b0 kernel/sched/idle.c:263
 cpu_startup_entry+0xc5/0xe0 kernel/sched/idle.c:369
 start_secondary+0x435/0x5c0 arch/x86/kernel/smpboot.c:271
 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243
----------------
Code disassembly (best guess):
   0:	48 89 df             	mov    %rbx,%rdi
   3:	e8 f4 20 7f f9       	callq  0xf97f20fc
   8:	e9 2e ff ff ff       	jmpq   0xffffff3b
   d:	48 89 df             	mov    %rbx,%rdi
  10:	e8 e7 20 7f f9       	callq  0xf97f20fc
  15:	eb 82                	jmp    0xffffff99
  17:	90                   	nop
  18:	90                   	nop
  19:	90                   	nop
  1a:	90                   	nop
  1b:	90                   	nop
  1c:	e9 07 00 00 00       	jmpq   0x28
  21:	0f 00 2d 14 43 4e 00 	verw   0x4e4314(%rip)        # 0x4e433c
  28:	fb                   	sti
  29:	f4                   	hlt
* 2a:	c3                   	retq <-- trapping instruction
  2b:	90                   	nop
  2c:	e9 07 00 00 00       	jmpq   0x38
  31:	0f 00 2d 04 43 4e 00 	verw   0x4e4304(%rip)        # 0x4e433c
  38:	f4                   	hlt
  39:	c3                   	retq
  3a:	90                   	nop
  3b:	90                   	nop
  3c:	41 56                	push   %r14
  3e:	41 55                	push   %r13

Crashes (839):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/09 03:26 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/12/08 01:30 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/08/23 09:46 linux-4.19.y 3f8a27f9e27b 26a13b38 .config console log report syz C ci2-linux-4-19 possible deadlock in uart_write
2020/03/02 03:52 linux-4.19.y a083db76118d 4a4e0509 .config console log report syz C ci2-linux-4-19
2020/03/01 20:59 linux-4.19.y a083db76118d c88c7b75 .config console log report syz C ci2-linux-4-19
2023/02/27 05:48 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/21 17:56 linux-4.19.y 3f8a27f9e27b f949448d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/19 14:30 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/16 04:09 linux-4.19.y 3f8a27f9e27b 6be0f1f5 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/10 04:29 linux-4.19.y 3f8a27f9e27b 07980f9d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/08 05:30 linux-4.19.y 3f8a27f9e27b 15c3d445 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/02/04 15:21 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/28 11:40 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/28 01:35 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/27 13:22 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/26 12:08 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/24 23:53 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2023/01/13 12:10 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/12/24 18:41 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/12/23 07:44 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/12/10 11:29 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/12/08 00:50 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/30 21:25 linux-4.19.y 3f8a27f9e27b 4c2a66e8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/30 13:26 linux-4.19.y 3f8a27f9e27b 4c2a66e8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/30 00:55 linux-4.19.y 3f8a27f9e27b 579a3740 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/23 20:50 linux-4.19.y 3f8a27f9e27b 52fdf57a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/20 03:43 linux-4.19.y 3f8a27f9e27b 5bb70014 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/16 00:44 linux-4.19.y 3f8a27f9e27b 3a127a31 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/09 17:41 linux-4.19.y 3f8a27f9e27b bebca8b7 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/09 02:27 linux-4.19.y 3f8a27f9e27b 5fa28208 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/06 09:08 linux-4.19.y 3f8a27f9e27b 6d752409 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/11/03 14:13 linux-4.19.y 3f8a27f9e27b 7a2ebf95 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/31 04:23 linux-4.19.y 3f8a27f9e27b 2a71366b .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/27 10:03 linux-4.19.y 3f8a27f9e27b 86777b7f .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/26 04:10 linux-4.19.y 3f8a27f9e27b 2159e4d2 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/24 00:39 linux-4.19.y 3f8a27f9e27b 23bf86af .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/20 15:27 linux-4.19.y 3f8a27f9e27b b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/20 02:47 linux-4.19.y 3f8a27f9e27b b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/19 20:22 linux-4.19.y 3f8a27f9e27b b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/17 09:43 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/15 01:32 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/05 13:43 linux-4.19.y 3f8a27f9e27b 267e3bb1 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/04 02:28 linux-4.19.y 3f8a27f9e27b feb56351 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/10/02 21:51 linux-4.19.y 3f8a27f9e27b feb56351 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/29 19:15 linux-4.19.y 3f8a27f9e27b 45fd7169 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/29 06:31 linux-4.19.y 3f8a27f9e27b a41a2080 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/27 19:21 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/22 17:01 linux-4.19.y 3f8a27f9e27b 0042f2b4 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/22 13:30 linux-4.19.y 3f8a27f9e27b 60af5050 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/20 23:13 linux-4.19.y 3f8a27f9e27b c4b8ccfd .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/19 20:14 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/17 01:57 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/17 00:55 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in uart_write
2022/09/14 05:40 linux-4.19.y 3f8a27f9e27b b884348d .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/14 01:08 linux-4.19.y 3f8a27f9e27b b884348d .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/12 18:07 linux-4.19.y 3f8a27f9e27b f371ed7e .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/12 13:59 linux-4.19.y 3f8a27f9e27b 356d8217 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/12 10:00 linux-4.19.y 3f8a27f9e27b 356d8217 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/12 07:51 linux-4.19.y 3f8a27f9e27b 356d8217 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/08 20:41 linux-4.19.y 3f8a27f9e27b f3027468 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2022/09/06 21:31 linux-4.19.y 3f8a27f9e27b 65aea2b9 .config console log report info ci2-linux-4-19 possible deadlock in uart_write
2021/01/09 17:27 linux-4.19.y 610bdbf6a174 a6c52263 .config console log report info ci2-linux-4-19
2020/02/04 05:04 linux-4.19.y 32ee7492f104 93e5e335 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.