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: 1791d, last: 668d
Fix bisection: failed (error log, bisect log)
  
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.19 possible deadlock in uart_write C 839 663d 1782d 0/1 upstream: reported C repro on 2020/02/04 05:05
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
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2022/04/03 05:20 17m bisect fix linux-4.14.y error job log
2021/11/16 11:26 25m bisect fix linux-4.14.y OK (0) job log log
2021/10/17 10:59 27m bisect fix linux-4.14.y OK (0) job log log
2021/09/17 10:32 26m bisect fix linux-4.14.y OK (0) job log log
2021/08/18 10:04 28m bisect fix linux-4.14.y OK (0) job log log
2021/07/19 09:36 27m bisect fix linux-4.14.y OK (0) job log log
2021/06/19 09:00 35m bisect fix linux-4.14.y OK (0) job log log
2020/12/18 23:39 30m bisect fix linux-4.14.y OK (0) job log log
2020/11/18 23:07 31m bisect fix linux-4.14.y OK (0) job log log

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

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

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

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.14.302-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: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/0xc70 drivers/tty/serial/8250/8250_port.c:1828
 serial8250_handle_irq.part.0+0x2c7/0x390 drivers/tty/serial/8250/8250_port.c:1918
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1891 [inline]
 serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1934
 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+0xed/0x240 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:578
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
RSP: 0018:ffff8880b5477e68 EFLAGS: 000002c2 ORIG_RAX: ffffffffffffffc8
RAX: 1ffffffff11e13dc RBX: dffffc0000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880b5464bc4
RBP: ffffffff88f09ed0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffed1016a8c868
R13: ffff8880b5464340 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 (394):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/17 14:34 linux-4.14.y c4215ee4771b 05494336 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/12/06 07:03 linux-4.14.y 179ef7fe8677 045cbb84 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/08/23 18:34 linux-4.14.y b641242202ed cea8b0f7 .config console log report syz C ci2-linux-4-14 possible deadlock in uart_write
2022/05/15 23:50 linux-4.14.y 690285a9380d 744a39e2 .config console log report syz C ci2-linux-4-14 possible deadlock in uart_write
2020/03/06 06:46 linux-4.14.y 78d697fc93f9 b655d91b .config console log report syz C ci2-linux-4-14
2020/03/01 20:56 linux-4.14.y 78d697fc93f9 c88c7b75 .config console log report syz C ci2-linux-4-14
2023/02/22 05:21 linux-4.14.y a8ad60f2af58 42a4d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/02/07 14:34 linux-4.14.y a8ad60f2af58 5bc3be51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/02/06 10:32 linux-4.14.y a8ad60f2af58 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/02/03 03:27 linux-4.14.y 3949d1610004 33fc5c09 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/02/01 18:22 linux-4.14.y 3949d1610004 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/01/30 21:25 linux-4.14.y 3949d1610004 b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/01/23 10:14 linux-4.14.y 97205fccccdc 44388686 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2023/01/10 04:42 linux-4.14.y c4215ee4771b 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/12/05 23:33 linux-4.14.y 179ef7fe8677 045cbb84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/12/05 22:31 linux-4.14.y 179ef7fe8677 045cbb84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/18 05:40 linux-4.14.y e911713e40ca 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/18 03:17 linux-4.14.y e911713e40ca 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/17 16:49 linux-4.14.y e911713e40ca 4ba8ab94 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/08 15:28 linux-4.14.y a901bb6c7db7 060f945e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/03 19:44 linux-4.14.y a901bb6c7db7 7a2ebf95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/03 14:08 linux-4.14.y a85772d7ba90 7a2ebf95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/11/01 05:47 linux-4.14.y 41f36d7859a7 a1d8560a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/10/28 07:41 linux-4.14.y 41f36d7859a7 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/10/28 03:23 linux-4.14.y 41f36d7859a7 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in uart_write
2022/10/22 08:41 linux-4.14.y 9d5c0b3a8e1a c0b80a55 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/17 09:36 linux-4.14.y 9d5c0b3a8e1a 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/13 09:31 linux-4.14.y 9d5c0b3a8e1a 3f6b40a1 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/12 18:34 linux-4.14.y 9d5c0b3a8e1a 16a9c9e0 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/05 23:12 linux-4.14.y 9d5c0b3a8e1a 2c6543ad .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/05 07:42 linux-4.14.y 9d5c0b3a8e1a 267e3bb1 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/10/01 11:57 linux-4.14.y 9d5c0b3a8e1a feb56351 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/09/15 13:33 linux-4.14.y 5df8b4735177 dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/09/07 14:45 linux-4.14.y 65640c873dcf c5b7bc57 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/08/26 16:14 linux-4.14.y e548869f356f e5a303f1 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/25 12:42 linux-4.14.y e548869f356f 514514f6 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in uart_write
2022/08/24 12:57 linux-4.14.y b641242202ed 514514f6 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/19 03:07 linux-4.14.y b641242202ed 26a13b38 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/18 20:30 linux-4.14.y b641242202ed 26a13b38 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/16 23:11 linux-4.14.y b641242202ed 9e4b39c2 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/08 11:55 linux-4.14.y b641242202ed 88e3a122 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/05 09:55 linux-4.14.y b641242202ed a65a7ce9 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/08/02 21:41 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/28 11:56 linux-4.14.y 9c3bf9cf362f fb95c74d .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/19 08:53 linux-4.14.y 424a46ea058e 72a3cc0c .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/18 15:20 linux-4.14.y 424a46ea058e ff988920 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/18 01:33 linux-4.14.y 424a46ea058e 95cb00d1 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/16 01:52 linux-4.14.y 424a46ea058e 95cb00d1 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/15 23:55 linux-4.14.y 424a46ea058e 95cb00d1 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/15 14:56 linux-4.14.y 424a46ea058e 5d921b08 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/11 23:55 linux-4.14.y 1048779a1d7d da3d6955 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/07/10 09:21 linux-4.14.y 1048779a1d7d b5765a15 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/28 01:11 linux-4.14.y f051383ef03b ef82eb2c .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/16 12:46 linux-4.14.y 84bae26850e3 1719ee24 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/04 15:33 linux-4.14.y 501eec4f9e13 c8857892 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/03 17:09 linux-4.14.y 501eec4f9e13 eee80d3c .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/02 22:51 linux-4.14.y 501eec4f9e13 02dddea8 .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2022/06/02 12:33 linux-4.14.y 501eec4f9e13 6e12f05f .config console log report info ci2-linux-4-14 possible deadlock in uart_write
2021/01/14 16:46 linux-4.14.y f79dc86058bc 468dbb55 .config console log report info ci2-linux-4-14
2020/01/26 11:09 linux-4.14.y 8bac50406cca f4e7270e .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.