block nbd11: Receive control failed (result -32) block nbd11: shutting down sockets ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_dec include/linux/atomic/atomic-instrumented.h:592 [inline] BUG: KASAN: slab-use-after-free in recv_work+0x215e/0x24f0 drivers/block/nbd.c:1022 Write of size 4 at addr ffff8880756c1078 by task kworker/u9:3/5835 CPU: 0 UID: 0 PID: 5835 Comm: kworker/u9:3 Not tainted 6.15.0-rc4-syzkaller-00736-gcb9d6b2c2a60 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Workqueue: nbd11-recv recv_work Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x29a/0x2b0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec include/linux/atomic/atomic-instrumented.h:592 [inline] recv_work+0x215e/0x24f0 drivers/block/nbd.c:1022 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 8924: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4372 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] nbd_alloc_and_init_config+0x88/0x260 drivers/block/nbd.c:1659 nbd_genl_connect+0x9dd/0x1930 drivers/block/nbd.c:2121 genl_family_rcv_msg_doit+0x212/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x219/0x490 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:727 ____sys_sendmsg+0x505/0x830 net/socket.c:2566 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620 __sys_sendmsg net/socket.c:2652 [inline] __do_sys_sendmsg net/socket.c:2657 [inline] __se_sys_sendmsg net/socket.c:2655 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2655 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5835: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2398 [inline] slab_free mm/slub.c:4656 [inline] kfree+0x193/0x440 mm/slub.c:4855 nbd_config_put+0x642/0x790 drivers/block/nbd.c:1449 recv_work+0x2148/0x24f0 drivers/block/nbd.c:1021 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8880756c1000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 120 bytes inside of freed 256-byte region [ffff8880756c1000, ffff8880756c1100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x756c0 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a041b40 ffffea0000480680 dead000000000007 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a041b40 ffffea0000480680 dead000000000007 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001d5b001 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5836, tgid 5836 (syz-executor), ts 93057316910, free_ts 92995840633 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x21e0/0x22c0 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4966 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2468 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2632 new_slab mm/slub.c:2686 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3872 __slab_alloc mm/slub.c:3962 [inline] __slab_alloc_node mm/slub.c:4037 [inline] slab_alloc_node mm/slub.c:4198 [inline] __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4367 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] ____ip_mc_inc_group+0x528/0xde0 net/ipv4/igmp.c:1535 __ip_mc_inc_group net/ipv4/igmp.c:1573 [inline] ip_mc_inc_group net/ipv4/igmp.c:1579 [inline] ip_mc_up+0x125/0x300 net/ipv4/igmp.c:1880 inetdev_event+0xfb3/0x15b0 net/ipv4/devinet.c:1631 notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2266 [inline] call_netdevice_notifiers net/core/dev.c:2280 [inline] __dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1 netif_change_flags+0xe8/0x1a0 net/core/dev.c:9489 do_setlink+0xcb9/0x40d0 net/core/rtnetlink.c:3152 rtnl_changelink net/core/rtnetlink.c:3770 [inline] __rtnl_newlink net/core/rtnetlink.c:3929 [inline] rtnl_newlink+0x160b/0x1c70 net/core/rtnetlink.c:4066 rtnetlink_rcv_msg+0x7cc/0xb70 net/core/rtnetlink.c:6955 page last free pid 5888 tgid 5888 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0xb14/0xce0 mm/page_alloc.c:2721 mm_free_pgd kernel/fork.c:793 [inline] __mmdrop+0xb5/0x460 kernel/fork.c:939 exit_mm+0x1da/0x2c0 kernel/exit.c:589 do_exit+0x859/0x2550 kernel/exit.c:940 do_group_exit+0x21c/0x2d0 kernel/exit.c:1102 __do_sys_exit_group kernel/exit.c:1113 [inline] __se_sys_exit_group kernel/exit.c:1111 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1111 x64_sys_call+0x21ba/0x21c0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880756c0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880756c0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880756c1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880756c1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880756c1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================