syzbot


INFO: task hung in n_tty_poll

Status: upstream: reported C repro on 2021/05/13 07:45
Reported-by: syzbot+1d86cfc6e8375fd32c59@syzkaller.appspotmail.com
First crash: 1290d, last: 898d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 INFO: task hung in n_tty_poll (2) C error 1 811d 901d 0/1 upstream: reported C repro on 2022/06/06 01:17
linux-4.14 INFO: task hung in n_tty_poll 1 1329d 1329d 0/1 auto-closed as invalid on 2021/08/01 20:04
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2021/11/09 10:38 11m bisect fix linux-4.19.y error job log
2021/10/10 10:09 28m bisect fix linux-4.19.y OK (0) job log log
2021/09/10 09:36 32m bisect fix linux-4.19.y OK (0) job log log
2021/08/11 08:45 31m bisect fix linux-4.19.y OK (0) job log log
2021/07/12 08:17 27m bisect fix linux-4.19.y OK (0) job log log
2021/06/12 07:45 32m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
Scheduler tracepoints stat_sleep, stat_iowait, stat_blocked and stat_runtime require the kernel parameter schedstats=enable or kernel.sched_schedstats=1
INFO: task syz-executor386:8116 blocked for more than 140 seconds.
      Not tainted 4.19.211-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor386 D27216  8116   8115 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2828 [inline]
 __schedule+0x887/0x2040 kernel/sched/core.c:3517
 schedule+0x8d/0x1b0 kernel/sched/core.c:3561
 schedule_timeout+0x92d/0xfe0 kernel/time/timer.c:1794
 do_wait_for_common kernel/sched/completion.c:83 [inline]
 __wait_for_common kernel/sched/completion.c:104 [inline]
 wait_for_common+0x29c/0x470 kernel/sched/completion.c:115
 __flush_work+0x4bb/0x8b0 kernel/workqueue.c:2926
 n_tty_poll+0x54d/0x8f0 drivers/tty/n_tty.c:2410
 tty_poll+0x139/0x1b0 drivers/tty/tty_io.c:2110
 vfs_poll include/linux/poll.h:90 [inline]
 do_select+0x8e1/0x1610 fs/select.c:507
 core_sys_select+0x3ac/0x7e0 fs/select.c:650
 do_pselect fs/select.c:731 [inline]
 __do_sys_pselect6 fs/select.c:772 [inline]
 __se_sys_pselect6+0x419/0x480 fs/select.c:757
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f825ede13c9
Code: Bad RIP value.
RSP: 002b:00007ffd2335cbb8 EFLAGS: 00000246 ORIG_RAX: 000000000000010e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f825ede13c9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000040
RBP: 00007ffd2335cbf0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 00007f825eda4990
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000

Showing all locks held in the system:
6 locks held by kworker/u4:2/37:
1 lock held by khungtaskd/1571:
 #0: 000000007fc17b8b (rcu_read_lock){....}, at: debug_show_all_locks+0x53/0x265 kernel/locking/lockdep.c:4441
1 lock held by in:imklog/7811:
 #0: 0000000073ced209 (&f->f_pos_lock){+.+.}, at: __fdget_pos+0x26f/0x310 fs/file.c:767
1 lock held by syz-executor386/8116:
 #0: 00000000d2b5d8e0 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:272

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

NMI backtrace for cpu 0
CPU: 0 PID: 1571 Comm: khungtaskd Not tainted 4.19.211-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+0x1fc/0x2ef lib/dump_stack.c:118
 nmi_cpu_backtrace.cold+0x63/0xa2 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x1a6/0x1f0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline]
 watchdog+0x991/0xe60 kernel/hung_task.c:287
 kthread+0x33f/0x460 kernel/kthread.c:259
 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: 37 Comm: kworker/u4:2 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_unbound flush_to_ldisc
RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:23 [inline]
RIP: 0010:check_kcov_mode kernel/kcov.c:67 [inline]
RIP: 0010:write_comp_data+0xf/0x70 kernel/kcov.c:122
Code: 8b 11 48 83 c2 01 48 39 d0 76 07 48 89 34 d1 48 89 11 c3 0f 1f 84 00 00 00 00 00 49 89 f1 49 89 fa 65 48 8b 34 25 c0 df 01 00 <65> 8b 05 7a 59 9f 7e a9 00 01 1f 00 75 4f 8b 86 60 13 00 00 83 f8
RSP: 0018:ffff8880b5147938 EFLAGS: 00000046
RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff813d5d0f
RDX: 0000000000000001 RSI: ffff8880b51382c0 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: ffff88813bfcd080
R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000008
FS:  0000000000000000(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555568bb2c0 CR3: 00000000a8814000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 unbound_pwq_by_node+0x1f/0x180 kernel/workqueue.c:564
 __queue_work+0x19f/0x1100 kernel/workqueue.c:1391
 queue_work_on+0x17e/0x1f0 kernel/workqueue.c:1489
 pty_write+0x195/0x1f0 drivers/tty/pty.c:126
 tty_put_char+0x122/0x150 drivers/tty/tty_io.c:2893
 __process_echoes+0x583/0x9f0 drivers/tty/n_tty.c:727
 flush_echoes drivers/tty/n_tty.c:827 [inline]
 __receive_buf drivers/tty/n_tty.c:1646 [inline]
 n_tty_receive_buf_common+0xc0c/0x2a90 drivers/tty/n_tty.c:1740
 tty_ldisc_receive_buf+0xa9/0x190 drivers/tty/tty_buffer.c:456
 tty_port_default_receive_buf+0x78/0xa0 drivers/tty/tty_port.c:38
 receive_buf drivers/tty/tty_buffer.c:476 [inline]
 flush_to_ldisc+0x21f/0x390 drivers/tty/tty_buffer.c:528
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
----------------
Code disassembly (best guess):
   0:	8b 11                	mov    (%rcx),%edx
   2:	48 83 c2 01          	add    $0x1,%rdx
   6:	48 39 d0             	cmp    %rdx,%rax
   9:	76 07                	jbe    0x12
   b:	48 89 34 d1          	mov    %rsi,(%rcx,%rdx,8)
   f:	48 89 11             	mov    %rdx,(%rcx)
  12:	c3                   	retq
  13:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  1a:	00
  1b:	49 89 f1             	mov    %rsi,%r9
  1e:	49 89 fa             	mov    %rdi,%r10
  21:	65 48 8b 34 25 c0 df 	mov    %gs:0x1dfc0,%rsi
  28:	01 00
* 2a:	65 8b 05 7a 59 9f 7e 	mov    %gs:0x7e9f597a(%rip),%eax        # 0x7e9f59ab <-- trapping instruction
  31:	a9 00 01 1f 00       	test   $0x1f0100,%eax
  36:	75 4f                	jne    0x87
  38:	8b 86 60 13 00 00    	mov    0x1360(%rsi),%eax
  3e:	83                   	.byte 0x83
  3f:	f8                   	clc

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/06/07 06:07 linux-4.19.y 3f8a27f9e27b c8857892 .config console log report syz C ci2-linux-4-19 INFO: task hung in n_tty_poll
2021/05/13 07:45 linux-4.19.y 3c8c23092588 ed7d41c5 .config console log report syz C ci2-linux-4-19 INFO: task hung in n_tty_poll
2022/06/09 09:43 linux-4.19.y 3f8a27f9e27b 0d5abf15 .config console log report info ci2-linux-4-19 INFO: task hung in n_tty_poll
2022/06/06 14:47 linux-4.19.y 3f8a27f9e27b c8857892 .config console log report info ci2-linux-4-19 INFO: task hung in n_tty_poll
* Struck through repros no longer work on HEAD.