================================================================== BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0xea/0x680 block/blk-mq.c:-1 Read of size 8 at addr ffff88802599bfe8 by task syz.4.3588/17368 CPU: 1 UID: 0 PID: 17368 Comm: syz.4.3588 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 blk_mq_free_rqs+0xea/0x680 block/blk-mq.c:-1 blk_mq_free_map_and_rqs+0x40/0xf0 block/blk-mq.c:4157 blk_mq_free_sched_tags block/blk-mq-sched.c:425 [inline] blk_mq_free_sched_res+0xeb/0x280 block/blk-mq-sched.c:436 elevator_change_done+0x1d2/0x5f0 block/elevator.c:639 elevator_change+0x321/0x450 block/elevator.c:685 elevator_set_none+0xb5/0x140 block/elevator.c:769 blk_mq_elv_switch_none block/blk-mq.c:5110 [inline] __blk_mq_update_nr_hw_queues block/blk-mq.c:5155 [inline] blk_mq_update_nr_hw_queues+0x5e7/0x1a60 block/blk-mq.c:5220 nbd_start_device+0x17f/0xb10 drivers/block/nbd.c:1489 nbd_genl_connect+0x165b/0x1cf0 drivers/block/nbd.c:2239 genl_family_rcv_msg_doit+0x22a/0x330 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x61c/0x7a0 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0x972/0x9f0 net/socket.c:2592 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcbad19c799 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcbab3ee028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcbad415fa0 RCX: 00007fcbad19c799 RDX: 0000000020000000 RSI: 0000200000001ac0 RDI: 0000000000000004 RBP: 00007fcbad232c99 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fcbad416038 R14: 00007fcbad415fa0 R15: 00007ffdbfc6fff8 Allocated by task 1: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5260 [inline] __kmalloc_node_noprof+0x4e0/0x7c0 mm/slub.c:5266 kmalloc_array_node_noprof include/linux/slab.h:1169 [inline] blk_mq_alloc_tag_set+0x4e3/0xfc0 block/blk-mq.c:4903 nbd_dev_add+0x30e/0xb50 drivers/block/nbd.c:1933 nbd_init+0x168/0x1f0 drivers/block/nbd.c:2692 do_one_initcall+0x250/0x8d0 init/main.c:1382 do_initcall_level+0x104/0x190 init/main.c:1444 do_initcalls+0x59/0xa0 init/main.c:1460 kernel_init_freeable+0x2a6/0x3e0 init/main.c:1692 kernel_init+0x1d/0x1d0 init/main.c:1582 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802599bfe0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes to the right of allocated 8-byte region [ffff88802599bfe0, ffff88802599bfe8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2599b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88813fea5500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800800080 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5427333986, free_ts 5420964183 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3292 [inline] allocate_slab+0x77/0x660 mm/slub.c:3481 new_slab mm/slub.c:3539 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7175 refill_sheaf mm/slub.c:2812 [inline] __pcs_replace_empty_main+0x2e6/0x730 mm/slub.c:4615 alloc_from_pcs mm/slub.c:4717 [inline] slab_alloc_node mm/slub.c:4851 [inline] __do_kmalloc_node mm/slub.c:5259 [inline] __kmalloc_node_track_caller_noprof+0x572/0x7b0 mm/slub.c:5368 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 __kernfs_new_node+0xa9/0x8e0 fs/kernfs/dir.c:633 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718 kernfs_create_link+0xa7/0x200 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x83/0x110 fs/sysfs/symlink.c:44 device_add_class_symlinks+0x1cf/0x240 drivers/base/core.c:3448 device_add+0x475/0xb70 drivers/base/core.c:3640 device_create_groups_vargs drivers/base/core.c:4371 [inline] device_create+0x269/0x300 drivers/base/core.c:4410 bdi_register_va+0x9c/0x770 mm/backing-dev.c:1098 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 vfree+0x25a/0x400 mm/vmalloc.c:3479 free_partitions block/partitions/core.c:114 [inline] check_partition block/partitions/core.c:173 [inline] blk_add_partitions block/partitions/core.c:590 [inline] bdev_disk_changed+0x8c1/0x1550 block/partitions/core.c:694 blkdev_get_whole+0x380/0x510 block/bdev.c:764 bdev_open+0x31e/0xd30 block/bdev.c:973 bdev_file_open_by_dev+0x1be/0x240 block/bdev.c:1075 disk_scan_partitions+0x1c1/0x2c0 block/genhd.c:387 add_disk_final block/genhd.c:416 [inline] add_disk_fwnode+0x321/0x480 block/genhd.c:610 add_disk include/linux/blkdev.h:785 [inline] brd_alloc+0x5b9/0x7c0 drivers/block/brd.c:340 brd_init+0xc1/0x120 drivers/block/brd.c:420 do_one_initcall+0x250/0x8d0 init/main.c:1382 do_initcall_level+0x104/0x190 init/main.c:1444 do_initcalls+0x59/0xa0 init/main.c:1460 kernel_init_freeable+0x2a6/0x3e0 init/main.c:1692 kernel_init+0x1d/0x1d0 init/main.c:1582 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 Memory state around the buggy address: ffff88802599be80: 00 fc fc fc 05 fc fc fc 00 fc fc fc 00 fc fc fc ffff88802599bf00: 04 fc fc fc 04 fc fc fc 04 fc fc fc 05 fc fc fc >ffff88802599bf80: 00 fc fc fc 05 fc fc fc 00 fc fc fc 00 fc fc fc ^ ffff88802599c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802599c080: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 ==================================================================