syzbot


INFO: task hung in nbd_add_socket (2)

Status: upstream: reported C repro on 2022/03/21 16:06
Reported-by: syzbot+cbb4b1ebc70d0c5a8c29@syzkaller.appspotmail.com
First crash: 195d, last: 8d22h

Cause bisection: failed (bisect log)
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in nbd_add_socket 75 233d 312d 0/24 closed as dup on 2021/11/21 13:59
linux-4.14 INFO: task hung in nbd_add_socket (2) C 2 23d 276d 0/1 upstream: reported C repro on 2021/12/25 23:00
linux-4.14 INFO: task hung in nbd_add_socket 1 568d 568d 0/1 auto-closed as invalid on 2021/07/06 19:04
linux-4.19 INFO: task hung in nbd_add_socket C error 9 106d 568d 0/1 upstream: reported C repro on 2021/03/08 23:07
upstream INFO: task can't die in blk_mq_freeze_queue_wait 221 309d 317d 22/24 fixed on 2022/03/08 16:11
Patch testing requests:
Created Duration User Patch Repo Result
2022/04/07 10:23 11m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ 3e732ebf7316 OK
2022/04/07 08:54 4m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ 3e732ebf7316 error

Sample crash report:
INFO: task syz-executor387:3652 blocked for more than 143 seconds.
      Not tainted 6.0.0-rc6-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor387 state:D stack:28376 pid: 3652 ppid:  3642 flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5182 [inline]
 __schedule+0xadf/0x52b0 kernel/sched/core.c:6494
 schedule+0xda/0x1b0 kernel/sched/core.c:6570
 blk_mq_freeze_queue_wait+0x112/0x160 block/blk-mq.c:180
 nbd_add_socket+0x166/0x810 drivers/block/nbd.c:1123
 __nbd_ioctl drivers/block/nbd.c:1464 [inline]
 nbd_ioctl+0x4ab/0xbd0 drivers/block/nbd.c:1521
 blkdev_ioctl+0x36e/0x800 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 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+0x63/0xcd
RIP: 0033:0x7f410c074399
RSP: 002b:00007fff2d5fb438 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000007801c RCX: 00007f410c074399
RDX: 0000000000000004 RSI: 000000000000ab00 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007fff2d5fb5d8 R09: 00007fff2d5fb5d8
R10: 00007fff2d5fb5d8 R11: 0000000000000246 R12: 00007fff2d5fb44c
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
 </TASK>
INFO: task udevd:3653 blocked for more than 143 seconds.
      Not tainted 6.0.0-rc6-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd           state:D stack:27648 pid: 3653 ppid:  2972 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5182 [inline]
 __schedule+0xadf/0x52b0 kernel/sched/core.c:6494
 schedule+0xda/0x1b0 kernel/sched/core.c:6570
 io_schedule+0xba/0x130 kernel/sched/core.c:8714
 folio_wait_bit_common+0x3dd/0xa90 mm/filemap.c:1298
 folio_put_wait_locked mm/filemap.c:1472 [inline]
 do_read_cache_folio+0x2c0/0x510 mm/filemap.c:3501
 read_mapping_folio include/linux/pagemap.h:762 [inline]
 read_part_sector+0xf6/0x440 block/partitions/core.c:717
 adfspart_check_ICS+0x9a/0x890 block/partitions/acorn.c:360
 check_partition block/partitions/core.c:146 [inline]
 blk_add_partitions block/partitions/core.c:602 [inline]
 bdev_disk_changed block/partitions/core.c:688 [inline]
 bdev_disk_changed+0x65f/0xfc0 block/partitions/core.c:655
 blkdev_get_whole+0x18a/0x2d0 block/bdev.c:684
 blkdev_get_by_dev.part.0+0x5ec/0xb90 block/bdev.c:821
 blkdev_get_by_dev+0x6b/0x80 block/bdev.c:855
 blkdev_open+0x13c/0x2c0 block/fops.c:485
 do_dentry_open+0x4a4/0x13a0 fs/open.c:878
 do_open fs/namei.c:3557 [inline]
 path_openat+0x1c92/0x28f0 fs/namei.c:3691
 do_filp_open+0x1b6/0x400 fs/namei.c:3718
 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311
 do_sys_open fs/open.c:1327 [inline]
 __do_sys_openat fs/open.c:1343 [inline]
 __se_sys_openat fs/open.c:1338 [inline]
 __x64_sys_openat+0x13f/0x1f0 fs/open.c:1338
 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+0x63/0xcd
RIP: 0033:0x7f3271b86697
RSP: 002b:00007ffe2bfe5ab0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00005567eaac41c0 RCX: 00007f3271b86697
RDX: 00000000000a0800 RSI: 00005567eaab86b0 RDI: 00000000ffffff9c
RBP: 00005567eaab86b0 R08: 0000000000000001 R09: 00007ffe2bfe8080
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000a0800
R13: 00005567eaac81b0 R14: 00007ffe2bfe5b5c R15: 00005567eaa8f2c0
 </TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
 #0: ffffffff8bf85db0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:507
1 lock held by rcu_tasks_trace/13:
 #0: ffffffff8bf85ab0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:507
1 lock held by khungtaskd/28:
 #0: ffffffff8bf86900 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6492
2 locks held by getty/3285:
 #0: ffff8880281fb098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
 #1: ffffc90001c482f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xef0/0x13e0 drivers/tty/n_tty.c:2177
1 lock held by syz-executor387/3652:
 #0: ffff888146e9d998 (&nbd->config_lock){+.+.}-{3:3}, at: nbd_ioctl+0x151/0xbd0 drivers/block/nbd.c:1514
1 lock held by udevd/3653:
 #0: ffff88801e1274c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev.part.0+0x9b/0xb90 block/bdev.c:812

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

NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.0.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
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+0x46/0x14f lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x206/0x250 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:212 [inline]
 watchdog+0xc18/0xf50 kernel/hung_task.c:369
 kthread+0x2e4/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1 skipped: idling at native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
NMI backtrace for cpu 1 skipped: idling at arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
NMI backtrace for cpu 1 skipped: idling at acpi_safe_halt+0x6f/0xb0 drivers/acpi/processor_idle.c:112

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2022/07/16 16:04 upstream 9b59ec8d50a1 97582466 .config log report syz C
ci-upstream-kasan-gce-smack-root 2022/06/09 09:03 upstream 6bfb56e93bce 97582466 .config log report syz C
ci-upstream-kasan-gce-smack-root 2022/05/09 23:50 upstream 9be9ed2612b5 97582466 .config log report syz C
* Struck through repros no longer work on HEAD.
Crashes (25):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2022/09/19 18:23 upstream 521a547ced64 dd9a85ff .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/09/18 13:57 upstream a335366bad13 dd9a85ff .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/09/18 06:19 upstream a335366bad13 dd9a85ff .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/09/18 04:17 upstream a335366bad13 dd9a85ff .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-root 2022/09/08 08:26 upstream 0066f1b0e275 435aeef7 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/09/05 06:24 upstream 7726d4c3e60b 28811d0a .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/09/02 12:23 upstream 42e66b1cc3a0 a805568e .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/08/23 20:10 upstream 072e51356cd5 cea8b0f7 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/08/20 08:36 upstream 4c2d0b039c5c 26a13b38 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-root 2022/08/13 15:16 upstream 7ebfc85e2cd7 8dfcaa3d .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/08/06 10:01 upstream 200e340f2196 e853abd9 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/04/07 05:35 upstream 3e732ebf7316 97582466 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/04/07 05:23 upstream 3e732ebf7316 97582466 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/09/12 01:36 linux-next e47eb90a0a9a 356d8217 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/08/21 10:43 linux-next 8755ae45a9e8 26a13b38 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/08/15 00:44 linux-next 6c8f479764eb 8dfcaa3d .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/08/14 02:56 linux-next 6c8f479764eb 8dfcaa3d .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/08/12 18:00 linux-next 6c8f479764eb 402cd70d .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/08/11 08:45 linux-next 6c8f479764eb a6201f11 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-linux-next-kasan-gce-root 2022/06/16 14:03 linux-next 6012273897fe 1719ee24 .config log report syz C INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-root 2022/03/17 15:46 upstream 56e337f2cf13 dfa9a8ed .config log report syz INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-smack-root 2022/04/07 02:49 upstream 3e732ebf7316 97582466 .config log report info INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-selinux-root 2022/04/07 02:49 upstream 3e732ebf7316 97582466 .config log report info INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-root 2022/04/07 02:45 upstream 3e732ebf7316 97582466 .config log report info INFO: task hung in nbd_add_socket
ci-upstream-kasan-gce-root 2022/03/17 13:28 upstream 56e337f2cf13 dfa9a8ed .config log report info INFO: task hung in nbd_add_socket
* Struck through repros no longer work on HEAD.