================================================================== BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0x6e2/0x760 block/blk-mq.c:3477 Read of size 8 at addr ffff88804ebbef28 by task syz.3.5723/23531 CPU: 2 UID: 0 PID: 23531 Comm: syz.3.5723 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 blk_mq_free_rqs+0x6e2/0x760 block/blk-mq.c:3477 blk_mq_alloc_rqs block/blk-mq.c:3658 [inline] blk_mq_alloc_map_and_rqs+0x9f9/0xeb0 block/blk-mq.c:4119 blk_mq_alloc_sched_tags+0x1de/0x350 block/blk-mq-sched.c:532 blk_mq_alloc_sched_res+0x8e/0x250 block/blk-mq-sched.c:555 blk_mq_alloc_sched_res_batch+0xfc/0x4f0 block/blk-mq-sched.c:593 __blk_mq_update_nr_hw_queues block/blk-mq.c:5132 [inline] blk_mq_update_nr_hw_queues+0x263/0x15f0 block/blk-mq.c:5211 nbd_start_device+0x1a6/0xbd0 drivers/block/nbd.c:1526 nbd_genl_connect+0xff2/0x1a40 drivers/block/nbd.c:2276 genl_family_rcv_msg_doit+0x214/0x300 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x560/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2555 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1899 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] ____sys_sendmsg+0x9e1/0xb70 net/socket.c:2684 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2738 __sys_sendmsg+0x160/0x210 net/socket.c:2770 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf704efec Code: Unable to access opcode bytes at 0xf704efc2. RSP: 002b:00000000f543d50c EFLAGS: 00000292 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 000000000000000f RCX: 0000000080001ac0 RDX: 000000000400400c RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 23413: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/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+0x321/0x890 mm/slub.c:5340 _kmalloc_array_node_noprof include/linux/slab.h:1271 [inline] blk_mq_alloc_tag_set+0x477/0x1330 block/blk-mq.c:4894 nbd_dev_add+0x342/0xb10 drivers/block/nbd.c:1970 nbd_genl_connect+0xb8d/0x1a40 drivers/block/nbd.c:2162 genl_family_rcv_msg_doit+0x214/0x300 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x560/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2555 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1899 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] ____sys_sendmsg+0x9e1/0xb70 net/socket.c:2684 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2738 __sys_sendmsg+0x160/0x210 net/socket.c:2770 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88804ebbef20 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 [ffff88804ebbef20, ffff88804ebbef28) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88804ebbed80 pfn:0x4ebbe flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000200 ffff88801b842500 ffffea0001953e50 ffffea00013a5f10 raw: ffff88804ebbed80 0000000800800037 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 0x1d2cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6134, tgid 6134 (syz-executor), ts 192693401026, free_ts 192693390400 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x812/0x3d20 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x27c/0x2b60 mm/page_alloc.c:5221 alloc_slab_page mm/slub.c:3289 [inline] allocate_slab mm/slub.c:3404 [inline] new_slab+0xa2/0x670 mm/slub.c:3447 refill_objects+0xe3/0x430 mm/slub.c:7241 refill_sheaf mm/slub.c:2827 [inline] __pcs_replace_empty_main+0x375/0x660 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_noprof+0x6bb/0x890 mm/slub.c:5340 _kmalloc_node_noprof include/linux/slab.h:1174 [inline] __vmalloc_area_node mm/vmalloc.c:3857 [inline] __vmalloc_node_range_noprof+0x409/0x1630 mm/vmalloc.c:4064 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4124 xt_compat_init_offsets+0xe2/0x1f0 net/netfilter/x_tables.c:779 compat_table_info+0xc5/0x600 net/ipv4/netfilter/ip_tables.c:932 get_info+0x25c/0x5f0 net/ipv4/netfilter/ip_tables.c:969 do_ipt_get_ctl+0x169/0xa10 net/ipv4/netfilter/ip_tables.c:1656 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4867 page last free pid 6134 tgid 6134 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1397 [inline] __free_frozen_pages+0x794/0x10a0 mm/page_alloc.c:2938 __kasan_populate_vmalloc_do mm/kasan/shadow.c:393 [inline] __kasan_populate_vmalloc+0x1ea/0x210 mm/kasan/shadow.c:424 kasan_populate_vmalloc include/linux/kasan.h:580 [inline] alloc_vmap_area+0x95d/0x2bb0 mm/vmalloc.c:2123 __get_vm_area_node+0x1ca/0x330 mm/vmalloc.c:3226 __vmalloc_node_range_noprof+0x228/0x1630 mm/vmalloc.c:4024 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4124 xt_compat_init_offsets+0xe2/0x1f0 net/netfilter/x_tables.c:779 compat_table_info+0xc5/0x600 net/ipv4/netfilter/ip_tables.c:932 get_info+0x25c/0x5f0 net/ipv4/netfilter/ip_tables.c:969 do_ipt_get_ctl+0x169/0xa10 net/ipv4/netfilter/ip_tables.c:1656 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4867 do_sock_getsockopt+0x50a/0x6e0 net/socket.c:2474 __sys_getsockopt+0x133/0x1d0 net/socket.c:2505 __do_compat_sys_socketcall net/compat.c:493 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x6af/0x770 net/compat.c:422 Memory state around the buggy address: ffff88804ebbee00: 00 fc fc fc 05 fc fc fc 05 fc fc fc fa fc fc fc ffff88804ebbee80: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc >ffff88804ebbef00: 05 fc fc fc 00 fc fc fc 05 fc fc fc fa fc fc fc ^ ffff88804ebbef80: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ffff88804ebbf000: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================