================================================================== BUG: KASAN: slab-use-after-free in genl_done+0x76/0x220 net/netlink/genetlink.c:1038 Write of size 8 at addr ffff88811b796788 by task syz.0.34/6007 CPU: 0 UID: 0 PID: 6007 Comm: syz.0.34 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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 genl_done+0x76/0x220 net/netlink/genetlink.c:1038 netlink_dump_cleanup+0x99/0x120 net/netlink/af_netlink.c:2259 netlink_dump+0xbe9/0xf40 net/netlink/af_netlink.c:2385 __netlink_dump_start+0x5cb/0x7e0 net/netlink/af_netlink.c:2455 genl_family_rcv_msg_dumpit+0x213/0x310 net/netlink/genetlink.c:1075 genl_family_rcv_msg net/netlink/genetlink.c:1191 [inline] genl_rcv_msg+0x5e8/0x7a0 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2565 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1890 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:0x7fe33999c819 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:00007fe33a8da028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fe339c16090 RCX: 00007fe33999c819 RDX: 0000000000000000 RSI: 0000200000000040 RDI: 0000000000000004 RBP: 00007fe339a32c91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe339c16128 R14: 00007fe339c16090 R15: 00007ffe15e728b8 Allocated by task 6007: 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] __kmalloc_cache_noprof+0x31c/0x660 mm/slub.c:5380 kmalloc_noprof include/linux/slab.h:950 [inline] genl_dumpit_info_alloc net/netlink/genetlink.c:915 [inline] genl_start+0x1c9/0x6c0 net/netlink/genetlink.c:985 __netlink_dump_start+0x469/0x7e0 net/netlink/af_netlink.c:2446 genl_family_rcv_msg_dumpit+0x213/0x310 net/netlink/genetlink.c:1075 genl_family_rcv_msg net/netlink/genetlink.c:1191 [inline] genl_rcv_msg+0x5e8/0x7a0 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2565 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1890 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 Freed by task 6006: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2685 [inline] slab_free mm/slub.c:6165 [inline] kfree+0x1c5/0x640 mm/slub.c:6483 genl_dumpit_info_free net/netlink/genetlink.c:920 [inline] genl_done+0x1c8/0x220 net/netlink/genetlink.c:1046 netlink_dump_cleanup+0x99/0x120 net/netlink/af_netlink.c:2259 netlink_dump+0xbe9/0xf40 net/netlink/af_netlink.c:2385 netlink_recvmsg+0x690/0xa50 net/netlink/af_netlink.c:1972 sock_recvmsg_nosec net/socket.c:1078 [inline] sock_recvmsg+0x172/0x1b0 net/socket.c:1100 sock_read_iter+0x251/0x320 net/socket.c:1170 new_sync_read fs/read_write.c:493 [inline] vfs_read+0x582/0xa70 fs/read_write.c:574 ksys_read+0x150/0x270 fs/read_write.c:717 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 The buggy address belongs to the object at ffff88811b796700 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 136 bytes inside of freed 192-byte region [ffff88811b796700, ffff88811b7967c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b796 flags: 0x17ff00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 017ff00000000000 ffff8881000413c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 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 5922, tgid 5922 (syz-executor), ts 64892204905, free_ts 61400269257 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1868 prep_new_page mm/page_alloc.c:1876 [inline] get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3956 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5236 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_noprof+0x577/0x7c0 mm/slub.c:5266 kmalloc_node_noprof include/linux/slab.h:1081 [inline] alloc_slab_obj_exts+0xbf/0x250 mm/slub.c:2167 __memcg_slab_post_alloc_hook+0x5c4/0xe80 mm/memcontrol.c:3466 memcg_slab_post_alloc_hook mm/slub.c:2457 [inline] slab_post_alloc_hook mm/slub.c:4549 [inline] slab_alloc_node mm/slub.c:4866 [inline] kmem_cache_alloc_noprof+0x347/0x650 mm/slub.c:4873 vm_area_dup+0x2b/0x680 mm/vma_init.c:123 dup_mmap+0x8b1/0x1d90 mm/mmap.c:1786 dup_mm kernel/fork.c:1531 [inline] copy_mm+0x13b/0x4a0 kernel/fork.c:1583 copy_process+0x18b6/0x3cd0 kernel/fork.c:2223 kernel_clone+0x248/0x8e0 kernel/fork.c:2653 __do_sys_clone kernel/fork.c:2794 [inline] __se_sys_clone kernel/fork.c:2778 [inline] __x64_sys_clone+0x1b6/0x230 kernel/fork.c:2778 page last free pid 10 tgid 10 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1412 [inline] __free_frozen_pages+0xbc7/0xd30 mm/page_alloc.c:2953 kasan_depopulate_vmalloc_pte+0x6d/0x90 mm/kasan/shadow.c:484 apply_to_pte_range mm/memory.c:3322 [inline] apply_to_pmd_range mm/memory.c:3366 [inline] apply_to_pud_range mm/memory.c:3402 [inline] apply_to_p4d_range mm/memory.c:3438 [inline] __apply_to_page_range+0xbdc/0x1420 mm/memory.c:3474 __kasan_release_vmalloc+0xa2/0xd0 mm/kasan/shadow.c:602 kasan_release_vmalloc include/linux/kasan.h:593 [inline] kasan_release_vmalloc_node mm/vmalloc.c:2284 [inline] purge_vmap_node+0x220/0x960 mm/vmalloc.c:2306 __purge_vmap_area_lazy+0x779/0xb70 mm/vmalloc.c:2396 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2430 process_one_work kernel/workqueue.c:3276 [inline] process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 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: ffff88811b796680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811b796700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811b796780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88811b796800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811b796880: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ==================================================================