syzbot


INFO: task hung in tty_set_termios (2)

Status: auto-closed as invalid on 2021/12/25 14:45
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 467d, last: 428d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 INFO: task hung in tty_set_termios (2) 3 174d 284d 0/1 auto-obsoleted due to no activity on 2022/10/05 22:41
upstream INFO: task hung in tty_set_termios 1 1705d 1703d 9/24 fixed on 2018/07/09 18:05
android-49 INFO: task hung in tty_set_termios 1 1618d 1618d 0/3 auto-closed as invalid on 2019/02/22 14:59
linux-4.19 INFO: task hung in tty_set_termios 1 740d 740d 0/1 auto-closed as invalid on 2021/03/18 18:50

Sample crash report:
INFO: task agetty:23424 blocked for more than 143 seconds.
      Not tainted 5.15.0-rc2-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:agetty          state:D stack:27024 pid:23424 ppid:     1 flags:0x00000000
Call Trace:
 context_switch kernel/sched/core.c:4940 [inline]
 __schedule+0x940/0x26f0 kernel/sched/core.c:6287
 schedule+0xd3/0x270 kernel/sched/core.c:6366
 rwsem_down_write_slowpath+0x7b9/0x11d0 kernel/locking/rwsem.c:1107
 __down_write_common kernel/locking/rwsem.c:1262 [inline]
 __down_write_common kernel/locking/rwsem.c:1259 [inline]
 __down_write kernel/locking/rwsem.c:1271 [inline]
 down_write+0x137/0x150 kernel/locking/rwsem.c:1518
 tty_set_termios+0xfe/0x910 drivers/tty/tty_ioctl.c:352
 set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438
 set_termios drivers/tty/tty_ioctl.c:392 [inline]
 tty_mode_ioctl+0xd0e/0xe70 drivers/tty/tty_ioctl.c:728
 n_tty_ioctl_helper+0x53/0x2d0 drivers/tty/tty_ioctl.c:907
 n_tty_ioctl+0x56/0x370 drivers/tty/n_tty.c:2421
 tty_ioctl+0xc69/0x1670 drivers/tty/tty_io.c:2814
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f735ee066b8
RSP: 002b:00007ffee5440950 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000010 RCX: 00007f735ee066b8
RDX: 00007ffee54408f0 RSI: 0000000000005402 RDI: 0000000000000000
RBP: 00007ffee54408f0 R08: 0000000000000000 R09: 00007ffee5440a20
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 000055ee0280d900 R14: 00007ffee54409e0 R15: 0000000000000012

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 #0: ffffffff8b97fe60 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6446
2 locks held by kworker/u4:2/150:
1 lock held by in:imklog/6226:
 #0: ffff88801acaeff0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:990
2 locks held by agetty/23424:
 #0: ffff888074a41098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:252
 #1: ffff888074a412e8 (&tty->termios_rwsem){++++}-{3:3}, at: tty_set_termios+0xfe/0x910 drivers/tty/tty_ioctl.c:352
5 locks held by syz-executor.2/23560:

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

NMI backtrace for cpu 1
CPU: 1 PID: 27 Comm: khungtaskd Not tainted 5.15.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:105
 nmi_trigger_cpumask_backtrace+0x1ae/0x220 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
 watchdog+0xc1d/0xf50 kernel/hung_task.c:295
 kthread+0x3e5/0x4d0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 150 Comm: kworker/u4:2 Not tainted 5.15.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
RIP: 0010:match_held_lock+0xe/0xc0 kernel/locking/lockdep.c:5077
Code: 48 c7 c7 20 fb 8b 89 e8 aa 19 be ff e8 37 e1 cc ff 31 c0 5d c3 0f 1f 80 00 00 00 00 53 48 89 fb 48 83 ec 08 48 39 77 10 74 6a <66> f7 47 22 f0 ff 74 5a 48 8b 46 08 48 89 f7 48 85 c0 74 42 8b 15
RSP: 0018:ffffc900016efae0 EFLAGS: 00000083
RAX: 000000000000000a RBX: ffff8880120edfc8 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffffffff8b97fda0 RDI: ffff8880120edfc8
RBP: ffffffff8b97fda0 R08: 0000000000000000 R09: ffff8880b9c32a0b
R10: ffffed1017386541 R11: 0000000000000000 R12: ffff8880120ed580
R13: ffff8880120edf78 R14: 00000000ffffffff R15: ffff8880120edfc8
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c001c433c8 CR3: 000000000b68e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
 __lock_is_held kernel/locking/lockdep.c:5368 [inline]
 lock_is_held_type+0xa7/0x140 kernel/locking/lockdep.c:5668
 lock_is_held include/linux/lockdep.h:283 [inline]
 rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:125
 trace_lock_release include/trace/events/lock.h:58 [inline]
 lock_release+0x522/0x720 kernel/locking/lockdep.c:5636
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:174 [inline]
 _raw_spin_unlock_bh+0x12/0x30 kernel/locking/spinlock.c:210
 spin_unlock_bh include/linux/spinlock.h:408 [inline]
 batadv_nc_purge_paths+0x2a5/0x3a0 net/batman-adv/network-coding.c:473
 batadv_nc_worker+0x8f9/0xfa0 net/batman-adv/network-coding.c:722
 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444
 kthread+0x3e5/0x4d0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
----------------
Code disassembly (best guess):
   0:	48 c7 c7 20 fb 8b 89 	mov    $0xffffffff898bfb20,%rdi
   7:	e8 aa 19 be ff       	callq  0xffbe19b6
   c:	e8 37 e1 cc ff       	callq  0xffcce148
  11:	31 c0                	xor    %eax,%eax
  13:	5d                   	pop    %rbp
  14:	c3                   	retq
  15:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)
  1c:	53                   	push   %rbx
  1d:	48 89 fb             	mov    %rdi,%rbx
  20:	48 83 ec 08          	sub    $0x8,%rsp
  24:	48 39 77 10          	cmp    %rsi,0x10(%rdi)
  28:	74 6a                	je     0x94
* 2a:	66 f7 47 22 f0 ff    	testw  $0xfff0,0x22(%rdi) <-- trapping instruction
  30:	74 5a                	je     0x8c
  32:	48 8b 46 08          	mov    0x8(%rsi),%rax
  36:	48 89 f7             	mov    %rsi,%rdi
  39:	48 85 c0             	test   %rax,%rax
  3c:	74 42                	je     0x80
  3e:	8b                   	.byte 0x8b
  3f:	15                   	.byte 0x15

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2021/09/26 14:38 upstream a3b397b4fffb 8cac236e .config log report info INFO: task hung in tty_set_termios
ci-upstream-kasan-gce-root 2021/08/19 04:57 upstream d6d09a694205 a2fe1cb5 .config log report info INFO: task hung in tty_set_termios
* Struck through repros no longer work on HEAD.