================================================================== BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0xde/0x680 block/blk-mq.c:-1 Read of size 8 at addr ffff8880275a8608 by task syz.3.20210/22429 CPU: 1 UID: 0 PID: 22429 Comm: syz.3.20210 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 blk_mq_free_rqs+0xde/0x680 block/blk-mq.c:-1 blk_mq_alloc_rqs block/blk-mq.c:3658 [inline] blk_mq_alloc_map_and_rqs+0x813/0x9d0 block/blk-mq.c:4119 blk_mq_alloc_sched_tags+0x14d/0x380 block/blk-mq-sched.c:532 blk_mq_alloc_sched_res+0x92/0x360 block/blk-mq-sched.c:555 blk_mq_alloc_sched_res_batch+0x187/0x670 block/blk-mq-sched.c:593 __blk_mq_update_nr_hw_queues block/blk-mq.c:5132 [inline] blk_mq_update_nr_hw_queues+0x2fe/0x19f0 block/blk-mq.c:5211 nbd_start_device+0x189/0xb30 drivers/block/nbd.c:1526 nbd_genl_connect+0x1597/0x1c10 drivers/block/nbd.c:2276 genl_family_rcv_msg_doit+0x233/0x340 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x614/0x7a0 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2556 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7bb/0x940 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] ____sys_sendmsg+0x9b9/0xa20 net/socket.c:2684 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2738 __sys_sendmsg net/socket.c:2770 [inline] __do_sys_sendmsg net/socket.c:2775 [inline] __se_sys_sendmsg net/socket.c:2773 [inline] __x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2773 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f17e279ce59 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:00007f17e35a3028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f17e2a16180 RCX: 00007f17e279ce59 RDX: 000000000400400c RSI: 0000200000001ac0 RDI: 000000000000000c RBP: 00007f17e2832e6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f17e2a16218 R14: 00007f17e2a16180 R15: 00007fff5bf3edd8 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:5334 [inline] __kmalloc_node_noprof+0x4dc/0x7b0 mm/slub.c:5340 _kmalloc_array_node_noprof include/linux/slab.h:1271 [inline] blk_mq_alloc_tag_set+0x533/0x1000 block/blk-mq.c:4894 nbd_dev_add+0x30e/0xb60 drivers/block/nbd.c:1970 nbd_init+0x15f/0x1e0 drivers/block/nbd.c:2729 do_one_initcall+0x250/0x870 init/main.c:1347 do_initcall_level+0x10a/0x1a0 init/main.c:1409 do_initcalls+0x59/0xa0 init/main.c:1425 kernel_init_freeable+0x29d/0x3e0 init/main.c:1658 kernel_init+0x1d/0x1d0 init/main.c:1548 ret_from_fork+0x514/0xb70 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 ffff8880275a8600 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 [ffff8880275a8600, ffff8880275a8608) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x275a8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88813fe1b500 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 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5246060743, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x24ae/0x2530 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221 alloc_slab_page mm/slub.c:3289 [inline] allocate_slab+0x74/0x5d0 mm/slub.c:3404 new_slab mm/slub.c:3447 [inline] refill_objects+0x328/0x3c0 mm/slub.c:7241 refill_sheaf mm/slub.c:2827 [inline] __pcs_replace_empty_main+0x2e0/0x6b0 mm/slub.c:4692 alloc_from_pcs mm/slub.c:4790 [inline] slab_alloc_node mm/slub.c:4924 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_node_track_caller_noprof+0x565/0x7b0 mm/slub.c:5438 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 __kernfs_new_node+0xa9/0x980 fs/kernfs/dir.c:661 kernfs_new_node fs/kernfs/dir.c:751 [inline] kernfs_create_dir_ns+0xfe/0x230 fs/kernfs/dir.c:1120 sysfs_create_dir_ns+0x12f/0x2a0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x622/0xcd0 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_add+0x163/0x240 lib/kobject.c:426 device_add+0x3fa/0xb80 drivers/base/core.c:3695 __add_disk+0x503/0xe30 block/genhd.c:496 add_disk_fwnode+0xfb/0x4b0 block/genhd.c:597 page_owner free stack trace missing Memory state around the buggy address: ffff8880275a8500: 05 fc fc fc 06 fc fc fc 05 fc fc fc 05 fc fc fc ffff8880275a8580: 05 fc fc fc 00 fc fc fc 04 fc fc fc 00 fc fc fc >ffff8880275a8600: 00 fc fc fc 06 fc fc fc 06 fc fc fc 06 fc fc fc ^ ffff8880275a8680: 06 fc fc fc 06 fc fc fc 06 fc fc fc 06 fc fc fc ffff8880275a8700: 06 fc fc fc 02 fc fc fc 05 fc fc fc 06 fc fc fc ==================================================================