syzbot


INFO: task hung in tty_ldisc_hangup

Status: fixed on 2020/03/18 22:57
Reported-by: syzbot+867ab30bf29852e02b1c@syzkaller.appspotmail.com
Fix commit: a4719f6d07b2 vt: selection, push sel_lock up
First crash: 1594d, last: 1522d
Fix bisection: fixed by (bisect log) :
commit a4719f6d07b2c63223f7452c435c5f578f105cfe
Author: Jiri Slaby <jslaby@suse.cz>
Date: Fri Feb 28 11:54:06 2020 +0000

  vt: selection, push sel_lock up

  
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 INFO: task hung in tty_ldisc_hangup (2) C error 1 933d 1083d 0/1 upstream: reported C repro on 2021/05/02 05:40
upstream INFO: task hung in tty_ldisc_hangup (2) serial 1 870d 870d 0/26 closed as invalid on 2022/02/07 19:09
linux-4.14 INFO: task hung in tty_ldisc_hangup (2) 1 1132d 1132d 0/1 auto-closed as invalid on 2021/07/12 09:20
linux-4.19 INFO: task hung in tty_ldisc_hangup C done 10 1526d 1594d 1/1 fixed on 2020/03/16 09:27
upstream INFO: task hung in tty_ldisc_hangup C inconclusive done 15 1520d 1595d 0/26 closed as dup on 2020/07/30 01:09

Sample crash report:
INFO: task login:7531 blocked for more than 140 seconds.
      Not tainted 4.14.160-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
login           D28096  7531      1 0x80000002
Call Trace:
 context_switch kernel/sched/core.c:2808 [inline]
 __schedule+0x7b8/0x1cd0 kernel/sched/core.c:3384
 schedule+0x92/0x1c0 kernel/sched/core.c:3428
 schedule_timeout+0x93b/0xe10 kernel/time/timer.c:1723
 down_write_failed drivers/tty/tty_ldsem.c:298 [inline]
 __ldsem_down_write_nested+0x304/0x7b0 drivers/tty/tty_ldsem.c:360
 ldsem_down_write+0x33/0x39 drivers/tty/tty_ldsem.c:402
 __tty_ldisc_lock drivers/tty/tty_ldisc.c:332 [inline]
 tty_ldisc_lock+0x50/0x80 drivers/tty/tty_ldisc.c:356
 tty_ldisc_hangup+0x1a6/0x5e0 drivers/tty/tty_ldisc.c:758
 __tty_hangup.part.0+0x2d3/0x6d0 drivers/tty/tty_io.c:622
 __tty_hangup drivers/tty/tty_io.c:572 [inline]
 tty_vhangup_session+0x25/0x30 drivers/tty/tty_io.c:732
 disassociate_ctty.part.0+0x9b/0x6c0 drivers/tty/tty_jobctrl.c:266
 disassociate_ctty+0x78/0x90 drivers/tty/tty_jobctrl.c:260
 do_exit+0x1799/0x2c80 kernel/exit.c:852
 do_group_exit+0x111/0x330 kernel/exit.c:951
 SYSC_exit_group kernel/exit.c:962 [inline]
 SyS_exit_group+0x1d/0x20 kernel/exit.c:960
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x7fd80303a1e8
RSP: 002b:00007ffe772104e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd80303a1e8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007fd80330f840 R08: 00000000000000e7 R09: ffffffffffffffa8
R10: 00007fd803315740 R11: 0000000000000246 R12: 00007fd80330f840
R13: 0000000000000001 R14: 0000000000000001 R15: 000000000060b798

Showing all locks held in the system:
1 lock held by khungtaskd/1038:
 #0:  (tasklist_lock){.+.+}, at: [<ffffffff8148c8d8>] debug_show_all_locks+0x7f/0x21f kernel/locking/lockdep.c:4544
2 locks held by getty/7014:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7015:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7016:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7017:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7018:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7019:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff83491c76>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by login/7531:
 #0:  (&tty->legacy_mutex){+.+.}, at: [<ffffffff834a4478>] tty_lock+0x68/0x80 drivers/tty/tty_mutex.c:19
 #1:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f863>] ldsem_down_write+0x33/0x39 drivers/tty/tty_ldsem.c:402
3 locks held by syz-executor619/7613:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff8664f823>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&buf->lock){+.+.}, at: [<ffffffff834a043f>] tty_buffer_lock_exclusive+0x1f/0x30 drivers/tty/tty_buffer.c:60
 #2:  (&rq->lock){-.-.}, at: [<ffffffff8663d86a>] rq_lock kernel/sched/sched.h:1741 [inline]
 #2:  (&rq->lock){-.-.}, at: [<ffffffff8663d86a>] __schedule+0x1da/0x1cd0 kernel/sched/core.c:3321

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 1038 Comm: khungtaskd Not tainted 4.14.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 nmi_cpu_backtrace.cold+0x57/0x94 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x141/0x189 lib/nmi_backtrace.c:62
 arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
 trigger_all_cpu_backtrace include/linux/nmi.h:140 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:195 [inline]
 watchdog+0x5e7/0xb90 kernel/hung_task.c:274
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 7613 Comm: syz-executor619 Not tainted 4.14.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8880848f8480 task.stack: ffff88809f2c0000
RIP: 0010:trace_hardirqs_on+0xd/0x10 kernel/locking/lockdep.c:2934
RSP: 0018:ffff88809f2c78c8 EFLAGS: 00000046
RAX: 0000000000000007 RBX: ffff8880848f8aa0 RCX: 1ffff1101091f1a9
RDX: 0000000000000000 RSI: ffff8880848f8d28 RDI: ffff8880848f8cfc
RBP: ffff88809f2c78c8 R08: ffff8880848f8480 R09: ffff8880848f8d48
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880aec2b540
R13: ffff88809f2c7950 R14: ffff8880848f8480 R15: ffff8880aec2b540
FS:  0000000002456880(0000) GS:ffff8880aec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000dce000 CR3: 00000000a51a5000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
 _raw_spin_unlock_irq+0x28/0x90 kernel/locking/spinlock.c:200
 rq_unlock_irq kernel/sched/sched.h:1766 [inline]
 __schedule+0x137b/0x1cd0 kernel/sched/core.c:3387
 schedule+0x92/0x1c0 kernel/sched/core.c:3428
 paste_selection+0x293/0x3f2 drivers/tty/vt/selection.c:355
 tioclinux+0x10e/0x400 drivers/tty/vt/vt.c:2696
 vt_ioctl+0x180c/0x2170 drivers/tty/vt/vt_ioctl.c:364
 tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441219
RSP: 002b:00007fff3a25af58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441219
RDX: 0000000020000040 RSI: 000000000000541c RDI: 0000000000000003
RBP: 00000000000cf93c R08: 000000000000000d R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000
Code: 89 e8 68 9b 3f 00 e9 63 fe ff ff 48 c7 c7 20 3f b6 89 e8 57 9b 3f 00 e9 ba fe ff ff 66 90 55 48 89 e5 48 8b 7d 08 e8 63 fa ff ff <5d> c3 90 55 48 89 e5 41 57 41 56 41 55 41 54 49 89 fc 53 89 d3 

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/22 02:12 linux-4.14.y e1f7d50ae3a3 bc586918 .config console log report syz C ci2-linux-4-14
2019/12/15 19:17 linux-4.14.y a844dc4c5442 eef6e580 .config console log report syz C ci2-linux-4-14
2019/12/08 14:10 linux-4.14.y a844dc4c5442 1508f453 .config console log report syz C ci2-linux-4-14
2020/02/17 19:39 linux-4.14.y 98db2bf27b9e 72bfa6f2 .config console log report ci2-linux-4-14
2020/02/09 04:05 linux-4.14.y e0f8b8a65a47 06150bf1 .config console log report ci2-linux-4-14
2020/02/05 11:13 linux-4.14.y 9fa690a2a016 93e5e335 .config console log report ci2-linux-4-14
2020/01/20 22:48 linux-4.14.y c1141b3aab36 8eda0b95 .config console log report ci2-linux-4-14
2020/01/12 12:43 linux-4.14.y 6d0c334a400d 31290a45 .config console log report ci2-linux-4-14
2020/01/12 05:07 linux-4.14.y b0cdffaa546e 4c04afaa .config console log report ci2-linux-4-14
2020/01/09 15:00 linux-4.14.y b0cdffaa546e 4de4e9f0 .config console log report ci2-linux-4-14
2019/12/31 16:55 linux-4.14.y 4c5bf01e16a7 25a0186e .config console log report ci2-linux-4-14
2019/12/22 09:37 linux-4.14.y e1f7d50ae3a3 bc586918 .config console log report ci2-linux-4-14
2019/12/20 03:38 linux-4.14.y bfb9e5c03076 36650b4b .config console log report ci2-linux-4-14
2019/12/18 18:26 linux-4.14.y bfb9e5c03076 79b211f7 .config console log report ci2-linux-4-14
2019/12/18 15:49 linux-4.14.y bfb9e5c03076 64ca0a37 .config console log report ci2-linux-4-14
2019/12/18 11:23 linux-4.14.y bfb9e5c03076 64ca0a37 .config console log report ci2-linux-4-14
2019/12/17 17:10 linux-4.14.y a844dc4c5442 1af3875f .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.