syzbot


INFO: task hung in nbd_ioctl (3)
Status: upstream: reported C repro on 2020/09/28 07:17
Reported-by: syzbot+fe03c50d25c0188f7487@syzkaller.appspotmail.com
First crash: 607d, last: 9d23h

Cause bisection: introduced by (bisect log) :
commit e9e006f5fcf2bab59149cb38a48a4817c1b538b4
Author: Mike Christie <mchristi@redhat.com>
Date: Sun Aug 4 19:10:06 2019 +0000

  nbd: fix max number of supported devs

Crash: INFO: task hung in nbd_ioctl (log)
Repro: syz .config

Fix bisection: fixed by (bisect log) [merge commit]:
commit da0628559871475b482f015dc24c9bef372936e4
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon Dec 14 20:05:10 2020 +0000

  Merge tag 'tomoyo-pr-20201214' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1

similar bugs (7):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 INFO: task hung in nbd_ioctl C done 18 883d 957d 1/1 fixed on 2019/12/28 10:32
linux-4.14 INFO: task hung in nbd_ioctl (2) C done 16 630d 875d 1/1 fixed on 2020/10/21 11:01
upstream INFO: task hung in nbd_ioctl (2) 37 637d 690d 17/22 fixed on 2020/09/25 01:17
upstream INFO: task hung in nbd_ioctl C done 71 935d 970d 14/22 fixed on 2019/11/06 12:39
linux-4.19 INFO: task hung in nbd_ioctl C error 66 40d 958d 0/1 upstream: reported C repro on 2019/10/12 13:11
linux-4.14 INFO: task hung in nbd_ioctl (3) C 12 9d20h 561d 0/1 upstream: reported C repro on 2020/11/13 07:37
upstream INFO: task can't die in nbd_ioctl C done 7 95d 600d 0/22 upstream: reported C repro on 2020/10/05 07:20

Sample crash report:
INFO: task syz-executor220:3627 blocked for more than 143 seconds.
      Not tainted 5.16.0-rc5-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor220 state:D stack:25848 pid: 3627 ppid:  3626 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:4972 [inline]
 __schedule+0xa9a/0x4940 kernel/sched/core.c:6253
 schedule+0xd2/0x260 kernel/sched/core.c:6326
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1857
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common kernel/sched/completion.c:106 [inline]
 wait_for_common kernel/sched/completion.c:117 [inline]
 wait_for_completion+0x174/0x270 kernel/sched/completion.c:138
 flush_workqueue+0x3ed/0x15b0 kernel/workqueue.c:2870
 nbd_start_device_ioctl drivers/block/nbd.c:1408 [inline]
 __nbd_ioctl drivers/block/nbd.c:1471 [inline]
 nbd_ioctl+0x6d8/0xb10 drivers/block/nbd.c:1511
 blkdev_ioctl+0x37a/0x800 block/ioctl.c:609
 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:0x7f25c24ab389
RSP: 002b:00007ffd8ab5c898 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f25c24ab389
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffd8ab5ca38 R09: 00007ffd8ab5ca38
R10: 00007ffd8ab5ca38 R11: 0000000000000246 R12: 00007f25c246a6a0
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/26:
 #0: ffffffff8bb812e0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6458
3 locks held by kworker/u5:0/46:
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline]
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline]
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline]
 #0: ffff888147490938 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2269
 #1: ffffc90001177db0 ((work_completion)(&args->work)){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2273
 #2: ffff88807db23120 (sk_lock-AF_AX25){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1645 [inline]
 #2: ffff88807db23120 (sk_lock-AF_AX25){+.+.}-{0:0}, at: ax25_recvmsg+0xbc/0x850 net/ax25/af_ax25.c:1627
2 locks held by getty/3287:
 #0: ffff88807ec29098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:252
 #1: ffffc90002b8e2e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xcf0/0x1230 drivers/tty/n_tty.c:2113

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

NMI backtrace for cpu 0
CPU: 0 PID: 26 Comm: khungtaskd Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __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:111
 nmi_trigger_cpumask_backtrace+0x1b3/0x230 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+0x405/0x4f0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 10 Comm: kworker/u4:1 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:__pte_needs_invert arch/x86/include/asm/pgtable-invert.h:18 [inline]
RIP: 0010:protnone_mask arch/x86/include/asm/pgtable-invert.h:24 [inline]
RIP: 0010:pmd_pfn arch/x86/include/asm/pgtable.h:193 [inline]
RIP: 0010:pte_lockptr include/linux/mm.h:2319 [inline]
RIP: 0010:__get_locked_pte+0x1c6/0x4d0 mm/memory.c:1722
Code: ff 49 83 c7 80 0f 84 9b 02 00 00 e8 54 ac ca ff 4d 89 f7 31 ff 49 83 e7 9f 4c 89 fe e8 d3 ae ca ff 4d 85 ff 0f 84 10 01 00 00 <e8> 35 ac ca ff 4c 89 f6 31 ff e8 bb ae ca ff e8 26 ac ca ff 4d 89
RSP: 0018:ffffc90000f0f9c8 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 00002aaaaaaab000 RCX: 0000000140ba5007
RDX: 0000000000000000 RSI: ffff888011c7e280 RDI: 0000000000000003
RBP: ffff888140ba4aa8 R08: 0000000000000000 R09: ffffea000006f307
R10: ffffffff81ac389d R11: 000000000000003f R12: ffff888011c28740
R13: ffffc90000f0fa60 R14: 0000000140ba5067 R15: 0000000140ba5007
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe8fb3c448 CR3: 000000000b88e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 get_locked_pte include/linux/mm.h:2160 [inline]
 __text_poke+0x1ae/0x8c0 arch/x86/kernel/alternative.c:1000
 text_poke_bp_batch+0x3d7/0x560 arch/x86/kernel/alternative.c:1361
 text_poke_flush arch/x86/kernel/alternative.c:1451 [inline]
 text_poke_flush arch/x86/kernel/alternative.c:1448 [inline]
 text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1458
 arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146
 jump_label_update+0x1d5/0x430 kernel/jump_label.c:830
 static_key_enable_cpuslocked+0x1b1/0x260 kernel/jump_label.c:177
 static_key_enable+0x16/0x20 kernel/jump_label.c:190
 toggle_allocation_gate mm/kfence/core.c:732 [inline]
 toggle_allocation_gate+0x100/0x390 mm/kfence/core.c:724
 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445
 kthread+0x405/0x4f0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.166 msecs
----------------
Code disassembly (best guess):
   0:	ff 49 83             	decl   -0x7d(%rcx)
   3:	c7 80 0f 84 9b 02 00 	movl   $0x54e80000,0x29b840f(%rax)
   a:	00 e8 54
   d:	ac                   	lods   %ds:(%rsi),%al
   e:	ca ff 4d             	lret   $0x4dff
  11:	89 f7                	mov    %esi,%edi
  13:	31 ff                	xor    %edi,%edi
  15:	49 83 e7 9f          	and    $0xffffffffffffff9f,%r15
  19:	4c 89 fe             	mov    %r15,%rsi
  1c:	e8 d3 ae ca ff       	callq  0xffcaaef4
  21:	4d 85 ff             	test   %r15,%r15
  24:	0f 84 10 01 00 00    	je     0x13a
* 2a:	e8 35 ac ca ff       	callq  0xffcaac64 <-- trapping instruction
  2f:	4c 89 f6             	mov    %r14,%rsi
  32:	31 ff                	xor    %edi,%edi
  34:	e8 bb ae ca ff       	callq  0xffcaaef4
  39:	e8 26 ac ca ff       	callq  0xffcaac64
  3e:	4d                   	rex.WRB
  3f:	89                   	.byte 0x89

Crashes (18):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2021/12/13 16:48 upstream 2585cf9dfaad 49ca1f59 .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-selinux-root 2021/09/11 01:33 upstream bf9f243f23e6 5ae8508a .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2021/08/23 04:25 upstream 1bdc3d5be7e1 b599f2fc .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-smack-root 2021/08/08 15:31 upstream 85a90500f9a1 6972b106 .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2021/07/23 11:54 upstream 9bead1b58c4c bc5f1d88 .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-smack-root 2021/02/16 06:35 upstream f40ddce88593 98682e5e .config log report syz C INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-selinux-root 2020/09/29 09:51 upstream fb0155a09b02 1b88c6d5 .config log report syz
ci-upstream-kasan-gce-root 2020/09/28 04:35 upstream a1bffa48745a 5dd8aee8 .config log report syz
ci-upstream-kasan-gce-root 2022/05/18 11:03 upstream 210e04ff7681 744a39e2 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2022/03/27 04:45 upstream bddac7c1e02b 89bc8608 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2022/01/20 05:11 upstream 1d1df41c5a33 5da9499f .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-smack-root 2022/01/12 03:42 upstream 6f38be8f2ccd 44d1319a .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2021/12/19 11:19 upstream 3f667b5d4053 44068e19 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-selinux-root 2021/11/09 11:47 upstream e851dfae4371 8ab17e57 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-root 2021/05/05 08:04 upstream d2b6f8a17919 06c27ff5 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-smack-root 2021/04/09 13:26 upstream 4fa56ad0d12e 6a81331a .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-selinux-root 2021/02/18 20:23 upstream f40ddce88593 14052202 .config log report info INFO: task hung in nbd_ioctl
ci-upstream-kasan-gce-smack-root 2021/02/16 04:14 upstream f40ddce88593 98682e5e .config log report info INFO: task hung in nbd_ioctl