syzbot


INFO: task hung in tty_ldisc_hangup

Status: fixed on 2020/03/16 09:27
Reported-by: syzbot+dab078f17445b023b621@syzkaller.appspotmail.com
Fix commit: b4492f1e7456 vt: selection, push sel_lock up
First crash: 1093d, last: 1026d

Fix bisection: fixed by (bisect log) :
commit b4492f1e7456bd162714c0ec2815c2749d930844
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 432d 582d 0/1 upstream: reported C repro on 2021/05/02 05:40
upstream INFO: task hung in tty_ldisc_hangup (2) 1 369d 369d 0/24 closed as invalid on 2022/02/07 19:09
linux-4.14 INFO: task hung in tty_ldisc_hangup (2) 1 631d 631d 0/1 auto-closed as invalid on 2021/07/12 09:20
upstream INFO: task hung in tty_ldisc_hangup C inconclusive done 15 1019d 1094d 0/24 closed as dup on 2020/07/30 01:09
linux-4.14 INFO: task hung in tty_ldisc_hangup C done 17 1022d 1093d 1/1 fixed on 2020/03/18 22:57

Sample crash report:
INFO: task login:8053 blocked for more than 140 seconds.
      Not tainted 4.19.91-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
login           D27504  8053      1 0x80000002
Call Trace:
 context_switch kernel/sched/core.c:2826 [inline]
 __schedule+0x866/0x1dc0 kernel/sched/core.c:3515
 schedule+0x92/0x1c0 kernel/sched/core.c:3559
 schedule_timeout+0x8c8/0xfc0 kernel/time/timer.c:1782
 down_write_failed drivers/tty/tty_ldsem.c:284 [inline]
 __ldsem_down_write_nested+0x3b3/0x8f0 drivers/tty/tty_ldsem.c:346
 ldsem_down_write+0x33/0x40 drivers/tty/tty_ldsem.c:388
 __tty_ldisc_lock drivers/tty/tty_ldisc.c:320 [inline]
 tty_ldisc_lock+0x50/0x90 drivers/tty/tty_ldisc.c:344
 tty_ldisc_hangup+0x1b9/0x630 drivers/tty/tty_ldisc.c:746
 __tty_hangup.part.0+0x306/0x720 drivers/tty/tty_io.c:623
 __tty_hangup drivers/tty/tty_io.c:573 [inline]
 tty_vhangup_session+0x25/0x30 drivers/tty/tty_io.c:733
 disassociate_ctty.part.0+0xb4/0x6f0 drivers/tty/tty_jobctrl.c:267
 disassociate_ctty+0x81/0xa0 drivers/tty/tty_jobctrl.c:261
 do_exit+0x17bb/0x3080 kernel/exit.c:874
 do_group_exit+0x135/0x370 kernel/exit.c:979
 __do_sys_exit_group kernel/exit.c:990 [inline]
 __se_sys_exit_group kernel/exit.c:988 [inline]
 __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fba27cfa1e8
Code: Bad RIP value.
RSP: 002b:00007ffdcdc89ce8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fba27cfa1e8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007fba27fcf840 R08: 00000000000000e7 R09: ffffffffffffffa8
R10: 00007fba27fd5740 R11: 0000000000000246 R12: 00007fba27fcf840
R13: 0000000000000001 R14: 0000000000000001 R15: 000000000060b798

Showing all locks held in the system:
1 lock held by khungtaskd/1068:
 #0: 0000000059bdc926 (rcu_read_lock){....}, at: debug_show_all_locks+0x5f/0x27e kernel/locking/lockdep.c:4438
1 lock held by rsyslogd/7626:
 #0: 00000000df739f4b (&f->f_pos_lock){+.+.}, at: __fdget_pos+0xee/0x110 fs/file.c:767
2 locks held by getty/7750:
 #0: 0000000029740b48 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000f78c87c0 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7751:
 #0: 0000000060f34c3a (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000ccf7b93f (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7752:
 #0: 000000009b95219a (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000880c2b44 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7753:
 #0: 0000000058f77172 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 0000000087b2e7cf (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7754:
 #0: 0000000068b3961a (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000a83ca8b1 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/7755:
 #0: 0000000024ed2203 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 0000000035318b82 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by login/8053:
 #0: 000000002729b777 (&tty->legacy_mutex){+.+.}, at: tty_lock+0x73/0xb0 drivers/tty/tty_mutex.c:19
 #1: 00000000ee8a9d22 (&tty->ldisc_sem){++++}, at: ldsem_down_write+0x33/0x40 drivers/tty/tty_ldsem.c:388
3 locks held by syz-executor102/8140:

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

NMI backtrace for cpu 0
CPU: 0 PID: 1068 Comm: khungtaskd Not tainted 4.19.91-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 nmi_cpu_backtrace.cold+0x63/0xa4 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x1b0/0x1f8 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:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline]
 watchdog+0x9df/0xee0 kernel/hung_task.c:287
 kthread+0x354/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 8140 Comm: syz-executor102 Not tainted 4.19.91-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__sanitizer_cov_trace_pc+0x26/0x50 kernel/kcov.c:101
Code: 90 90 90 90 55 48 89 e5 48 8b 75 08 65 48 8b 04 25 40 ee 01 00 65 8b 15 78 a9 96 7e 81 e2 00 01 1f 00 75 2b 8b 90 d0 12 00 00 <83> fa 02 75 20 48 8b 88 d8 12 00 00 8b 80 d4 12 00 00 48 8b 11 48
RSP: 0018:ffff88808e2ff7d0 EFLAGS: 00000046
RAX: ffff88808d16e4c0 RBX: 0000000000000000 RCX: ffffffff81707a96
RDX: 0000000000000000 RSI: ffffffff81707a9f RDI: 0000000000000005
RBP: ffff88808e2ff7d0 R08: ffff88808d16e4c0 R09: ffffed1011a2dc9b
R10: ffffed1011a2dc9a R11: ffff88808d16e4d7 R12: 0000000000000000
R13: 000000000002c240 R14: ffff88808d16e4c0 R15: ffff8880ae92c240
FS:  0000000001db2880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 000000008f11f000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 trace_hardirqs_off+0x2f/0x220 kernel/trace/trace_preemptirq.c:37
 __schedule+0x1df/0x1dc0 kernel/sched/core.c:3442
 schedule+0x92/0x1c0 kernel/sched/core.c:3559
 paste_selection+0x2e8/0x443 drivers/tty/vt/selection.c:354
 tioclinux+0x133/0x470 drivers/tty/vt/vt.c:3019
 vt_ioctl+0x19ab/0x2530 drivers/tty/vt/vt_ioctl.c:364
 tty_ioctl+0x7f3/0x1510 drivers/tty/tty_io.c:2669
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441219
Code: e8 3c ad 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 9b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff38e276e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441219
RDX: 0000000020000040 RSI: 000000000000541c RDI: 0000000000000003
RBP: 00000000000a5c4d R08: 000000000000000d R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000

Crashes (10):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2019/12/22 02:10 linux-4.19.y 672481c2deff bc586918 .config log report syz C
ci2-linux-4-19 2019/12/16 06:32 linux-4.19.y 312017a460d5 eef6e580 .config log report syz C
ci2-linux-4-19 2019/12/16 00:04 linux-4.19.y 312017a460d5 eef6e580 .config log report syz C
ci2-linux-4-19 2019/12/15 19:19 linux-4.19.y 312017a460d5 eef6e580 .config log report syz C
ci2-linux-4-19 2019/12/08 14:29 linux-4.19.y fb683b5e3f53 1508f453 .config log report syz C
ci2-linux-4-19 2020/01/14 20:38 linux-4.19.y db5b9190ff82 fa12bd3c .config log report
ci2-linux-4-19 2020/01/14 20:25 linux-4.19.y db5b9190ff82 fa12bd3c .config log report
ci2-linux-4-19 2020/01/12 12:09 linux-4.19.y dcd888983542 31290a45 .config log report
ci2-linux-4-19 2020/01/09 11:23 linux-4.19.y cb1f9a169a0e ddc3e859 .config log report
ci2-linux-4-19 2020/01/03 10:56 linux-4.19.y c7ecf3e3a71c 9dcc1191 .config log report
* Struck through repros no longer work on HEAD.