syzbot


possible deadlock in uart_write
Status: upstream: reported C repro on 2019/12/26 21:25
Reported-by: syzbot+b0e376d3731cd5e82bb7@syzkaller.appspotmail.com
First crash: 885d, last: 159d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: WARNING in sysfs_warn_dup (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) [no-op commit]:
commit c6f7c753f71cccb21d1a7f0c1127ce7804374c5e
Author: Christoph Hellwig <hch@lst.de>
Date: Thu Sep 3 14:22:37 2020 +0000

  lkdtm: remove set_fs-based tests

similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in uart_write C 716 8h31m 843d 0/1 upstream: reported C repro on 2020/02/04 05:05
linux-4.14 possible deadlock in uart_write C error 334 1d19h 851d 0/1 upstream: reported C repro on 2020/01/26 11:10

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

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

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: ffff8880a41382b0 (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:338 [inline]
 #0: ffff8880a41382b0 (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x27/0x190 drivers/tty/serial/8250/8250_core.c:116
 #1: ffffffff8ceaee50 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x290 drivers/tty/serial/8250/8250_port.c:1822
 #2: ffff8880a67e7090 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:288

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.0-rc3-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:2370 [inline]
 check_deadlock kernel/locking/lockdep.c:2411 [inline]
 validate_chain kernel/locking/lockdep.c:2954 [inline]
 __lock_acquire.cold+0x114/0x288 kernel/locking/lockdep.c:3954
 lock_acquire+0x197/0x420 kernel/locking/lockdep.c:4484
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xbf kernel/locking/spinlock.c:159
 uart_write+0x1c7/0x680 drivers/tty/serial/serial_core.c:592
 n_hdlc_send_frames+0x283/0x470 drivers/tty/n_hdlc.c:401
 n_hdlc_tty_wakeup+0xb5/0xd0 drivers/tty/n_hdlc.c:477
 tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:536
 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:50
 serial8250_tx_chars+0x48f/0xae0 drivers/tty/serial/8250/8250_port.c:1760
 serial8250_handle_irq.part.0+0x24b/0x290 drivers/tty/serial/8250/8250_port.c:1833
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1819 [inline]
 serial8250_default_handle_irq+0xb5/0x140 drivers/tty/serial/8250/8250_port.c:1849
 serial8250_interrupt+0xe6/0x190 drivers/tty/serial/8250/8250_core.c:126
 __handle_irq_event_percpu+0x15d/0x950 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:830
 generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
 do_IRQ+0xd9/0x280 arch/x86/kernel/irq.c:250
 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:607
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: cc cc cc cc cc cc cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d 64 3f 4b 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d 54 3f 4b 00 fb f4 <c3> cc 41 56 41 55 41 54 55 53 e8 a3 cf a2 f9 e8 7e ff d4 fb 0f 1f
RSP: 0018:ffffc90000d3fdb8 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffd7
RAX: 1ffffffff12e7652 RBX: ffff8880a9644340 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffff8880a9644bd4
RBP: dffffc0000000000 R08: ffff8880a9644340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffed10152c8868
R13: 0000000000000001 R14: ffffffff8a65d980 R15: 0000000000000000
 arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline]
 default_idle+0x49/0x350 arch/x86/kernel/process.c:695
 cpuidle_idle_call kernel/sched/idle.c:154 [inline]
 do_idle+0x393/0x690 kernel/sched/idle.c:269
 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361
 start_secondary+0x2ee/0x400 arch/x86/kernel/smpboot.c:264
 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242

Crashes (609):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2020/03/07 06:48 upstream fb279f4e2386 fd2a5f28 .config log report syz C
ci-upstream-kasan-gce-root 2020/03/05 07:37 upstream 63623fd44972 c88c7b75 .config log report syz C
ci-upstream-kasan-gce-smack-root 2020/03/03 03:31 upstream 63623fd44972 c88c7b75 .config log report syz C
ci-upstream-kasan-gce 2020/03/01 01:44 upstream f8788d86ab28 59b57593 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/03/18 11:14 linux-next 770fbb32d34e 97bc55ce .config log report syz C
ci-upstream-kasan-gce-386 2020/03/01 06:37 upstream 63623fd44972 c88c7b75 .config log report syz
ci-upstream-kasan-gce-smack-root 2021/12/16 15:13 upstream 2b14864acbaa 8dd6a5e3 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/12/12 08:40 upstream a763d5a5abd6 49ca1f59 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/11 04:10 upstream b8a98b6bf66a 49ca1f59 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/09 09:27 upstream 2a987e65025e a4a2a501 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/08 07:44 upstream 2a987e65025e 0230ba3e .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/07 04:18 upstream f80ef9e49fdf 0230ba3e .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/06 04:43 upstream 944207047ca4 a617004c .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/12/04 20:36 upstream bbef3c7a63d2 a617004c .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/04 19:27 upstream bbef3c7a63d2 a617004c .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/12/04 09:25 upstream 12119cfa1052 a617004c .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/12/02 02:57 upstream 58e1100fdc59 61f86278 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/12/01 00:40 upstream f080815fdb3e 80270552 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/29 17:49 upstream d58071a8a76d d0830353 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/29 13:02 upstream d58071a8a76d 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/27 16:36 upstream c5c17547b778 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/27 00:33 upstream c5c17547b778 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/26 11:17 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/25 05:51 upstream 5f53fa508db0 545ab074 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/24 17:40 upstream 5d9f4cf36721 545ab074 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/22 01:08 upstream 40c93d7fff6f 4eb20a4e .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/21 09:12 upstream 923dcc5eb0c1 4eb20a4e .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/17 15:18 upstream 8ab774587903 cafff8b6 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/17 01:11 upstream 8ab774587903 cafff8b6 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/16 11:55 upstream 8ab774587903 600426bd .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/15 08:03 upstream fa55b7dcdc43 83f5c9b5 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/14 12:59 upstream ccfff0a2bd2a 83f5c9b5 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/12 18:00 upstream 5833291ab6de 83f5c9b5 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/11 11:50 upstream debe436e77c7 75b04091 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/10 21:58 upstream 881007522c8f 75b04091 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/08 08:04 upstream 6b75d88fa81b 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce 2021/11/07 11:03 upstream 512b7931ad05 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/06 22:32 upstream 512b7931ad05 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/05 20:46 upstream d4439a1189f9 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/04 15:52 upstream ce840177930f 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/03 19:38 upstream dcd68326d29b 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/11/03 15:47 upstream dcd68326d29b 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/11/03 00:09 upstream bfc484fe6abb 17f3edd2 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-smack-root 2021/11/02 17:37 upstream bfc484fe6abb 17f3edd2 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/10/30 20:44 upstream 119c85055d86 098b5d53 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-root 2021/10/30 19:40 upstream 119c85055d86 098b5d53 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-selinux-root 2021/10/29 23:43 upstream a379fbbcb88b 098b5d53 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/12/18 16:36 upstream 9eaa88c7036e 44068e19 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/12/17 03:03 upstream 6441998e2e37 44068e19 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/12/07 11:10 upstream f80ef9e49fdf 0230ba3e .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/27 19:38 upstream c5c17547b778 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/26 20:24 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/20 02:21 upstream 4c388a8e740d 3a9d0024 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/16 21:33 upstream 8ab774587903 600426bd .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/16 01:48 upstream 8ab774587903 83f5c9b5 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/03 14:36 upstream dcd68326d29b 4c1be0be .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce-386 2021/11/03 11:34 upstream dcd68326d29b 17f3edd2 .config log report info possible deadlock in uart_write
ci-upstream-linux-next-kasan-gce-root 2021/12/04 05:53 linux-next f81e94e91878 a617004c .config log report info possible deadlock in uart_write
ci-upstream-linux-next-kasan-gce-root 2021/11/25 21:03 linux-next f81e94e91878 63eeac02 .config log report info possible deadlock in uart_write
ci-upstream-linux-next-kasan-gce-root 2021/11/03 03:42 linux-next 9150de4aac1e 17f3edd2 .config log report info possible deadlock in uart_write
ci-upstream-linux-next-kasan-gce-root 2021/11/02 11:22 linux-next 9150de4aac1e 098b5d53 .config log report info possible deadlock in uart_write
ci-upstream-kasan-gce 2020/10/11 04:19 upstream da690031a5d6 4a77ae0b .config log report info
ci-upstream-kasan-gce-386 2019/12/24 05:06 upstream 46cf053efec6 be5c2c81 .config log report