syzbot


possible deadlock in __vsock_release

Status: closed as invalid on 2025/10/25 16:44
Subsystems: net virt
[Documentation on labels]
First crash: 138d, last: 138d

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.3.329/8842 is trying to acquire lock:
ffff80008fac3da0 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:318 [inline]
ffff80008fac3da0 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slub.c:4142 [inline]
ffff80008fac3da0 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:4220 [inline]
ffff80008fac3da0 (fs_reclaim){+.+.}-{0:0}, at: kmem_cache_alloc_node_noprof+0x60/0x3f4 mm/slub.c:4292

but task is already holding lock:
ffff0000f36a13d8 (sk_lock-AF_VSOCK){+.+.}-{0:0}, at: __vsock_release+0x38/0x3b8 net/vmw_vsock/af_vsock.c:860

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #6 (sk_lock-AF_VSOCK){+.+.}-{0:0}:
       lock_sock_nested+0x58/0x118 net/core/sock.c:3711
       lock_sock include/net/sock.h:1669 [inline]
       vsock_shutdown+0x70/0x280 net/vmw_vsock/af_vsock.c:1103
       kernel_sock_shutdown+0x6c/0x80 net/socket.c:3701
       nbd_mark_nsock_dead+0x2a4/0x534 drivers/block/nbd.c:318
       recv_work+0x1cf8/0x2044 drivers/block/nbd.c:1018
       process_one_work+0x7e8/0x155c kernel/workqueue.c:3236
       process_scheduled_works kernel/workqueue.c:3319 [inline]
       worker_thread+0x958/0xed8 kernel/workqueue.c:3400
       kthread+0x5fc/0x75c kernel/kthread.c:463
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844

-> #5 (&nsock->tx_lock){+.+.}-{4:4}:
       __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:598
       __mutex_lock kernel/locking/mutex.c:760 [inline]
       mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:812
       nbd_handle_cmd drivers/block/nbd.c:1140 [inline]
       nbd_queue_rq+0x20c/0xc48 drivers/block/nbd.c:1204
       blk_mq_dispatch_rq_list+0x890/0x1548 block/blk-mq.c:2120
       __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline]
       blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline]
       __blk_mq_sched_dispatch_requests+0xa7c/0x10e4 block/blk-mq-sched.c:307
       blk_mq_sched_dispatch_requests+0xa4/0x154 block/blk-mq-sched.c:329
       blk_mq_run_hw_queue+0x2d0/0x4a4 block/blk-mq.c:2358
       blk_mq_dispatch_list+0xa00/0xaf8 block/blk-mq.c:-1
       blk_mq_flush_plug_list+0x3a4/0x488 block/blk-mq.c:2967
       __blk_flush_plug+0x330/0x408 block/blk-core.c:1220
       blk_finish_plug block/blk-core.c:1247 [inline]
       __submit_bio+0x3f4/0x4d8 block/blk-core.c:649
       __submit_bio_noacct_mq block/blk-core.c:722 [inline]
       submit_bio_noacct_nocheck+0x390/0xaac block/blk-core.c:751
       submit_bio_noacct+0xc94/0x177c block/blk-core.c:874
       submit_bio+0x3b4/0x550 block/blk-core.c:916
       submit_bh_wbc+0x3ec/0x4bc fs/buffer.c:2824
       submit_bh fs/buffer.c:2829 [inline]
       block_read_full_folio+0x734/0x824 fs/buffer.c:2461
       blkdev_read_folio+0x28/0x38 block/fops.c:492
       filemap_read_folio+0xec/0x2f8 mm/filemap.c:2413
       do_read_cache_folio+0x364/0x5bc mm/filemap.c:3957
       read_cache_folio+0x68/0x88 mm/filemap.c:3989
       read_mapping_folio include/linux/pagemap.h:991 [inline]
       read_part_sector+0xcc/0x6fc block/partitions/core.c:722
       adfspart_check_ICS+0xa0/0x83c block/partitions/acorn.c:360
       check_partition block/partitions/core.c:141 [inline]
       blk_add_partitions block/partitions/core.c:589 [inline]
       bdev_disk_changed+0x674/0x11fc block/partitions/core.c:693
       blkdev_get_whole+0x2b0/0x4a4 block/bdev.c:748
       bdev_open+0x3b0/0xc20 block/bdev.c:957
       blkdev_open+0x364/0x4e8 block/fops.c:694
       do_dentry_open+0x7a4/0x10bc fs/open.c:965
       vfs_open+0x44/0x2d4 fs/open.c:1095
       do_open fs/namei.c:3887 [inline]
       path_openat+0x2424/0x2c40 fs/namei.c:4046
       do_filp_open+0x18c/0x36c fs/namei.c:4073
       do_sys_openat2+0x11c/0x1b4 fs/open.c:1435
       do_sys_open fs/open.c:1450 [inline]
       __do_sys_openat fs/open.c:1466 [inline]
       __se_sys_openat fs/open.c:1461 [inline]
       __arm64_sys_openat+0x120/0x158 fs/open.c:1461
       __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
       el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
       do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
       el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744
       el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
       el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

-> #4 (&cmd->lock){+.+.}-{4:4}:
       __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:598
       __mutex_lock kernel/locking/mutex.c:760 [inline]
       mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:812
       nbd_queue_rq+0xb4/0xc48 drivers/block/nbd.c:1196
       blk_mq_dispatch_rq_list+0x890/0x1548 block/blk-mq.c:2120
       __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline]
       blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline]
       __blk_mq_sched_dispatch_requests+0xa7c/0x10e4 block/blk-mq-sched.c:307
       blk_mq_sched_dispatch_requests+0xa4/0x154 block/blk-mq-sched.c:329
       blk_mq_run_hw_queue+0x2d0/0x4a4 block/blk-mq.c:2358
       blk_mq_dispatch_list+0xa00/0xaf8 block/blk-mq.c:-1
       blk_mq_flush_plug_list+0x3a4/0x488 block/blk-mq.c:2967
       __blk_flush_plug+0x330/0x408 block/blk-core.c:1220
       blk_finish_plug block/blk-core.c:1247 [inline]
       __submit_bio+0x3f4/0x4d8 block/blk-core.c:649
       __submit_bio_noacct_mq block/blk-core.c:722 [inline]
       submit_bio_noacct_nocheck+0x390/0xaac block/blk-core.c:751
       submit_bio_noacct+0xc94/0x177c block/blk-core.c:874
       submit_bio+0x3b4/0x550 block/blk-core.c:916
       submit_bh_wbc+0x3ec/0x4bc fs/buffer.c:2824
       submit_bh fs/buffer.c:2829 [inline]
       __bread_slow fs/buffer.c:1272 [inline]
       __bread_gfp+0x134/0x34c fs/buffer.c:1518
       sb_bread include/linux/buffer_head.h:346 [inline]
       minix_fill_super+0x124/0x1690 fs/minix/inode.c:196
       get_tree_bdev_flags+0x360/0x414 fs/super.c:1692
       get_tree_bdev+0x2c/0x3c fs/super.c:1715
       minix_get_tree+0x28/0x38 fs/minix/inode.c:377
       vfs_get_tree+0x90/0x28c fs/super.c:1815
       do_new_mount+0x278/0x7f4 fs/namespace.c:3808
       path_mount+0x5b4/0xde0 fs/namespace.c:4123
       do_mount fs/namespace.c:4136 [inline]
       __do_sys_mount fs/namespace.c:4347 [inline]
       __se_sys_mount fs/namespace.c:4324 [inline]
       __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4324
       __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
       el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
       do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
       el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744
       el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
       el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

-> #3 (set->srcu){.+.+}-{0:0}:
       srcu_lock_sync+0x2c/0x38 include/linux/srcu.h:173
       __synchronize_srcu+0xa0/0x348 kernel/rcu/srcutree.c:1429
       synchronize_srcu+0x2cc/0x338 kernel/rcu/srcutree.c:-1
       blk_mq_wait_quiesce_done block/blk-mq.c:283 [inline]
       blk_mq_quiesce_queue+0x118/0x16c block/blk-mq.c:303
       elevator_switch+0x12c/0x410 block/elevator.c:588
       elevator_change+0x264/0x3cc block/elevator.c:690
       elevator_set_default+0x138/0x21c block/elevator.c:766
       blk_register_queue+0x2b4/0x338 block/blk-sysfs.c:904
       __add_disk+0x560/0xb90 block/genhd.c:528
       add_disk_fwnode+0xdc/0x438 block/genhd.c:597
       device_add_disk+0x38/0x4c block/genhd.c:627
       add_disk include/linux/blkdev.h:774 [inline]
       nbd_dev_add+0x560/0x820 drivers/block/nbd.c:1973
       nbd_init+0x15c/0x174 drivers/block/nbd.c:2680
       do_one_initcall+0x250/0x990 init/main.c:1269
       do_initcall_level+0x128/0x1c4 init/main.c:1331
       do_initcalls+0x70/0xd0 init/main.c:1347
       do_basic_setup+0x78/0x8c init/main.c:1366
       kernel_init_freeable+0x268/0x39c init/main.c:1579
       kernel_init+0x24/0x1dc init/main.c:1469
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844

-> #2 (&q->elevator_lock){+.+.}-{4:4}:
       __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:598
       __mutex_lock kernel/locking/mutex.c:760 [inline]
       mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:812
       elevator_change+0x16c/0x3cc block/elevator.c:688
       elevator_set_none+0x48/0xac block/elevator.c:781
       blk_mq_elv_switch_none block/blk-mq.c:5023 [inline]
       __blk_mq_update_nr_hw_queues block/blk-mq.c:5066 [inline]
       blk_mq_update_nr_hw_queues+0x4c8/0x15f4 block/blk-mq.c:5124
       nbd_start_device+0x158/0xa48 drivers/block/nbd.c:1478
       nbd_genl_connect+0xf88/0x158c drivers/block/nbd.c:2228
       genl_family_rcv_msg_doit+0x1d8/0x2bc net/netlink/genetlink.c:1115
       genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
       genl_rcv_msg+0x450/0x624 net/netlink/genetlink.c:1210
       netlink_rcv_skb+0x220/0x3fc net/netlink/af_netlink.c:2552
       genl_rcv+0x38/0x50 net/netlink/genetlink.c:1219
       netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
       netlink_unicast+0x694/0x8c4 net/netlink/af_netlink.c:1346
       netlink_sendmsg+0x648/0x930 net/netlink/af_netlink.c:1896
       sock_sendmsg_nosec net/socket.c:714 [inline]
       __sock_sendmsg net/socket.c:729 [inline]
       ____sys_sendmsg+0x490/0x7b8 net/socket.c:2614
       ___sys_sendmsg+0x204/0x278 net/socket.c:2668
       __sys_sendmsg net/socket.c:2700 [inline]
       __do_sys_sendmsg net/socket.c:2705 [inline]
       __se_sys_sendmsg net/socket.c:2703 [inline]
       __arm64_sys_sendmsg+0x184/0x238 net/socket.c:2703
       __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
       el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
       do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
       el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744
       el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
       el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

-> #1 (&q->q_usage_counter(io)#33){++++}-{0:0}:
       blk_alloc_queue+0x48c/0x54c block/blk-core.c:461
       blk_mq_alloc_queue block/blk-mq.c:4400 [inline]
       __blk_mq_alloc_disk+0x124/0x304 block/blk-mq.c:4447
       nbd_dev_add+0x398/0x820 drivers/block/nbd.c:1943
       nbd_init+0x15c/0x174 drivers/block/nbd.c:2680
       do_one_initcall+0x250/0x990 init/main.c:1269
       do_initcall_level+0x128/0x1c4 init/main.c:1331
       do_initcalls+0x70/0xd0 init/main.c:1347
       do_basic_setup+0x78/0x8c init/main.c:1366
       kernel_init_freeable+0x268/0x39c init/main.c:1579
       kernel_init+0x24/0x1dc init/main.c:1469
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844

-> #0 (fs_reclaim){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3165 [inline]
       check_prevs_add kernel/locking/lockdep.c:3284 [inline]
       validate_chain kernel/locking/lockdep.c:3908 [inline]
       __lock_acquire+0x1774/0x30a4 kernel/locking/lockdep.c:5237
       lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868
       __fs_reclaim_acquire mm/page_alloc.c:4234 [inline]
       fs_reclaim_acquire+0x8c/0x118 mm/page_alloc.c:4248
       might_alloc include/linux/sched/mm.h:318 [inline]
       slab_pre_alloc_hook mm/slub.c:4142 [inline]
       slab_alloc_node mm/slub.c:4220 [inline]
       kmem_cache_alloc_node_noprof+0x60/0x3f4 mm/slub.c:4292
       __alloc_skb+0x144/0x2ec net/core/skbuff.c:659
       alloc_skb include/linux/skbuff.h:1336 [inline]
       alloc_skb_with_frags+0xb8/0x678 net/core/skbuff.c:6665
       __virtio_vsock_alloc_skb_with_frags include/linux/virtio_vsock.h:68 [inline]
       virtio_vsock_alloc_linear_skb include/linux/virtio_vsock.h:81 [inline]
       virtio_vsock_alloc_skb include/linux/virtio_vsock.h:87 [inline]
       virtio_transport_alloc_skb+0xd4/0xf3c net/vmw_vsock/virtio_transport_common.c:267
       virtio_transport_send_pkt_info+0x3fc/0xc60 net/vmw_vsock/virtio_transport_common.c:390
       virtio_transport_shutdown net/vmw_vsock/virtio_transport_common.c:1087 [inline]
       virtio_transport_close net/vmw_vsock/virtio_transport_common.c:1268 [inline]
       virtio_transport_release+0x1e0/0x668 net/vmw_vsock/virtio_transport_common.c:1291
       __vsock_release+0xa4/0x3b8 net/vmw_vsock/af_vsock.c:870
       vsock_release+0x98/0xfc net/vmw_vsock/af_vsock.c:982
       __sock_release net/socket.c:649 [inline]
       sock_close+0xa0/0x1e4 net/socket.c:1439
       __fput+0x340/0x75c fs/file_table.c:468
       ____fput+0x20/0x58 fs/file_table.c:496
       task_work_run+0x1dc/0x260 kernel/task_work.c:227
       resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
       exit_to_user_mode_loop+0xfc/0x168 kernel/entry/common.c:43
       exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
       arm64_exit_to_user_mode arch/arm64/kernel/entry-common.c:103 [inline]
       el0_svc+0x170/0x254 arch/arm64/kernel/entry-common.c:745
       el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
       el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

other info that might help us debug this:

Chain exists of:
  fs_reclaim --> &nsock->tx_lock --> sk_lock-AF_VSOCK

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_VSOCK);
                               lock(&nsock->tx_lock);
                               lock(sk_lock-AF_VSOCK);
  lock(fs_reclaim);

 *** DEADLOCK ***

2 locks held by syz.3.329/8842:
 #0: ffff0000de132608 (&sb->s_type->i_mutex_key#11){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:870 [inline]
 #0: ffff0000de132608 (&sb->s_type->i_mutex_key#11){+.+.}-{4:4}, at: __sock_release net/socket.c:648 [inline]
 #0: ffff0000de132608 (&sb->s_type->i_mutex_key#11){+.+.}-{4:4}, at: sock_close+0x7c/0x1e4 net/socket.c:1439
 #1: ffff0000f36a13d8 (sk_lock-AF_VSOCK){+.+.}-{0:0}, at: __vsock_release+0x38/0x3b8 net/vmw_vsock/af_vsock.c:860

stack backtrace:
CPU: 0 UID: 0 PID: 8842 Comm: syz.3.329 Not tainted syzkaller #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Call trace:
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C)
 __dump_stack+0x30/0x40 lib/dump_stack.c:94
 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120
 dump_stack+0x1c/0x28 lib/dump_stack.c:129
 print_circular_bug+0x324/0x32c kernel/locking/lockdep.c:2043
 check_noncircular+0x154/0x174 kernel/locking/lockdep.c:2175
 check_prev_add kernel/locking/lockdep.c:3165 [inline]
 check_prevs_add kernel/locking/lockdep.c:3284 [inline]
 validate_chain kernel/locking/lockdep.c:3908 [inline]
 __lock_acquire+0x1774/0x30a4 kernel/locking/lockdep.c:5237
 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868
 __fs_reclaim_acquire mm/page_alloc.c:4234 [inline]
 fs_reclaim_acquire+0x8c/0x118 mm/page_alloc.c:4248
 might_alloc include/linux/sched/mm.h:318 [inline]
 slab_pre_alloc_hook mm/slub.c:4142 [inline]
 slab_alloc_node mm/slub.c:4220 [inline]
 kmem_cache_alloc_node_noprof+0x60/0x3f4 mm/slub.c:4292
 __alloc_skb+0x144/0x2ec net/core/skbuff.c:659
 alloc_skb include/linux/skbuff.h:1336 [inline]
 alloc_skb_with_frags+0xb8/0x678 net/core/skbuff.c:6665
 __virtio_vsock_alloc_skb_with_frags include/linux/virtio_vsock.h:68 [inline]
 virtio_vsock_alloc_linear_skb include/linux/virtio_vsock.h:81 [inline]
 virtio_vsock_alloc_skb include/linux/virtio_vsock.h:87 [inline]
 virtio_transport_alloc_skb+0xd4/0xf3c net/vmw_vsock/virtio_transport_common.c:267
 virtio_transport_send_pkt_info+0x3fc/0xc60 net/vmw_vsock/virtio_transport_common.c:390
 virtio_transport_shutdown net/vmw_vsock/virtio_transport_common.c:1087 [inline]
 virtio_transport_close net/vmw_vsock/virtio_transport_common.c:1268 [inline]
 virtio_transport_release+0x1e0/0x668 net/vmw_vsock/virtio_transport_common.c:1291
 __vsock_release+0xa4/0x3b8 net/vmw_vsock/af_vsock.c:870
 vsock_release+0x98/0xfc net/vmw_vsock/af_vsock.c:982
 __sock_release net/socket.c:649 [inline]
 sock_close+0xa0/0x1e4 net/socket.c:1439
 __fput+0x340/0x75c fs/file_table.c:468
 ____fput+0x20/0x58 fs/file_table.c:496
 task_work_run+0x1dc/0x260 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop+0xfc/0x168 kernel/entry/common.c:43
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 arm64_exit_to_user_mode arch/arm64/kernel/entry-common.c:103 [inline]
 el0_svc+0x170/0x254 arch/arm64/kernel/entry-common.c:745
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/20 23:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 506ba4ea4cf5 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in __vsock_release
* Struck through repros no longer work on HEAD.