R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f41dae26038 R14: 00007f41dae25fa0 R15: 00007fff975c5fc8 ================================================================== BUG: KASAN: slab-out-of-bounds in blk_mq_free_rqs+0x6e2/0x760 block/blk-mq.c:3477 Read of size 8 at addr ffff888028e5b5e8 by task syz.2.471/7593 CPU: 1 UID: 0 PID: 7593 Comm: syz.2.471 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_free_map_and_rqs block/blk-mq.c:4148 [inline] blk_mq_free_map_and_rqs+0x30/0x120 block/blk-mq.c:4143 blk_mq_alloc_sched_tags+0x259/0x350 block/blk-mq-sched.c:542 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:5133 [inline] blk_mq_update_nr_hw_queues+0x263/0x15f0 block/blk-mq.c:5212 nbd_start_device+0x1a6/0xbd0 drivers/block/nbd.c:1530 nbd_genl_connect+0xfc2/0x1760 drivers/block/nbd.c:2310 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:2556 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:815 [inline] ____sys_sendmsg+0xa4d/0xbe0 net/socket.c:2713 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2767 __sys_sendmsg+0x160/0x210 net/socket.c:2799 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f41dab9e159 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:00007f41db9a8028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f41dae25fa0 RCX: 00007f41dab9e159 RDX: 0000000020000000 RSI: 0000200000000400 RDI: 0000000000000006 RBP: 00007f41db9a8090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f41dae26038 R14: 00007f41dae25fa0 R15: 00007fff975c5fc8 Allocated by task 1: 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:5414 [inline] __kmalloc_node_noprof+0x342/0x880 mm/slub.c:5426 _kmalloc_array_node_noprof include/linux/slab.h:1297 [inline] blk_mq_alloc_tag_set+0x477/0x1330 block/blk-mq.c:4894 nbd_dev_add+0x341/0xb10 drivers/block/nbd.c:1975 nbd_init+0x2c5/0x2e0 drivers/block/nbd.c:2743 do_one_initcall+0x11c/0x6f0 init/main.c:1357 do_initcall_level init/main.c:1419 [inline] do_initcalls init/main.c:1435 [inline] do_basic_setup init/main.c:1455 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1670 kernel_init+0x21/0x1e0 init/main.c:1560 ret_from_fork+0x730/0xd60 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 ffff888028e5b5e0 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 [ffff888028e5b5e0, ffff888028e5b5e8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888028e5b840 pfn:0x28e5b flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801c042500 ffffea0000b7c6d0 ffffea0000dbe0d0 raw: ffff888028e5b840 000000000080007d 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 5962307541 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_node_track_caller_noprof+0x6a8/0x870 mm/slub.c:5545 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x51/0xe0 mm/util.c:84 kstrdup_const+0x63/0x80 mm/util.c:104 __kernfs_new_node+0x9b/0xa10 fs/kernfs/dir.c:661 kernfs_new_node+0x117/0x150 fs/kernfs/dir.c:751 kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92 device_add_class_symlinks drivers/base/core.c:3520 [inline] device_add+0x675/0x1970 drivers/base/core.c:3712 __add_disk+0x518/0xe40 block/genhd.c:492 page last free pid 2 tgid 2 ts 5961015862 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 __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:2145 __get_vm_area_node+0x1ed/0x350 mm/vmalloc.c:3248 __vmalloc_node_range_noprof+0x268/0x1420 mm/vmalloc.c:4064 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4165 alloc_thread_stack_node kernel/fork.c:359 [inline] dup_task_struct kernel/fork.c:930 [inline] copy_process+0x803/0x8370 kernel/fork.c:2133 kernel_clone+0x176/0x9d0 kernel/fork.c:2766 kernel_thread+0xdb/0x120 kernel/fork.c:2827 create_kthread kernel/kthread.c:459 [inline] kthreadd+0x498/0x7a0 kernel/kthread.c:817 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888028e5b480: 07 fc fc fc 07 fc fc fc 07 fc fc fc 00 fc fc fc ffff888028e5b500: 00 fc fc fc 00 fc fc fc 07 fc fc fc 07 fc fc fc >ffff888028e5b580: 07 fc fc fc 00 fc fc fc 05 fc fc fc 00 fc fc fc ^ ffff888028e5b600: 07 fc fc fc 07 fc fc fc 07 fc fc fc fa fc fc fc ffff888028e5b680: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ==================================================================