netlink: 'syz.1.115': attribute type 1 has an invalid length. nbd: error processing sock list ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.115/6967 is trying to acquire lock: ffff0000cb462698 (sk_lock-AF_TIPC){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1669 [inline] ffff0000cb462698 (sk_lock-AF_TIPC){+.+.}-{0:0}, at: tipc_shutdown+0x74/0x508 net/tipc/socket.c:2802 but task is already holding lock: ffff0000db8d0e70 (&nsock->tx_lock){+.+.}-{4:4}, at: sock_shutdown+0x144/0x248 drivers/block/nbd.c:410 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (&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 -> #5 (&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] 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 (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 -> #3 (&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 -> #2 (&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 -> #1 (fs_reclaim){+.+.}-{0:0}: __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_fclone include/linux/skbuff.h:1386 [inline] tipc_buf_acquire net/tipc/msg.c:72 [inline] tipc_msg_build+0x118/0xc48 net/tipc/msg.c:390 __tipc_sendmsg+0x1898/0x27d4 net/tipc/socket.c:1501 tipc_sendmsg+0x60/0x14c net/tipc/socket.c:1399 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 -> #0 (sk_lock-AF_TIPC){+.+.}-{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 lock_sock_nested+0x58/0x118 net/core/sock.c:3711 lock_sock include/net/sock.h:1669 [inline] tipc_shutdown+0x74/0x508 net/tipc/socket.c:2802 kernel_sock_shutdown+0x6c/0x80 net/socket.c:3701 nbd_mark_nsock_dead+0x2a4/0x534 drivers/block/nbd.c:318 sock_shutdown+0x154/0x248 drivers/block/nbd.c:411 nbd_clear_sock drivers/block/nbd.c:1416 [inline] nbd_config_put+0x274/0x614 drivers/block/nbd.c:1440 nbd_genl_connect+0x8bc/0x158c drivers/block/nbd.c:2236 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 other info that might help us debug this: Chain exists of: sk_lock-AF_TIPC --> &cmd->lock --> &nsock->tx_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&nsock->tx_lock); lock(&cmd->lock); lock(&nsock->tx_lock); lock(sk_lock-AF_TIPC); *** DEADLOCK *** 4 locks held by syz.1.115/6967: #0: ffff800092adea30 (cb_lock){++++}-{4:4}, at: genl_rcv+0x28/0x50 net/netlink/genetlink.c:1218 #1: ffff800092ade848 (genl_mutex){+.+.}-{4:4}, at: genl_lock net/netlink/genetlink.c:35 [inline] #1: ffff800092ade848 (genl_mutex){+.+.}-{4:4}, at: genl_op_lock net/netlink/genetlink.c:60 [inline] #1: ffff800092ade848 (genl_mutex){+.+.}-{4:4}, at: genl_rcv_msg+0xf4/0x624 net/netlink/genetlink.c:1209 #2: ffff0000ca987a30 (&nbd->config_lock){+.+.}-{4:4}, at: refcount_dec_and_mutex_lock+0x40/0xf0 lib/refcount.c:118 #3: ffff0000db8d0e70 (&nsock->tx_lock){+.+.}-{4:4}, at: sock_shutdown+0x144/0x248 drivers/block/nbd.c:410 stack backtrace: CPU: 1 UID: 0 PID: 6967 Comm: syz.1.115 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 lock_sock_nested+0x58/0x118 net/core/sock.c:3711 lock_sock include/net/sock.h:1669 [inline] tipc_shutdown+0x74/0x508 net/tipc/socket.c:2802 kernel_sock_shutdown+0x6c/0x80 net/socket.c:3701 nbd_mark_nsock_dead+0x2a4/0x534 drivers/block/nbd.c:318 sock_shutdown+0x154/0x248 drivers/block/nbd.c:411 nbd_clear_sock drivers/block/nbd.c:1416 [inline] nbd_config_put+0x274/0x614 drivers/block/nbd.c:1440 nbd_genl_connect+0x8bc/0x158c drivers/block/nbd.c:2236 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 block nbd1: shutting down sockets