================================================================== BUG: KASAN: slab-use-after-free in read_pnet include/net/net_namespace.h:414 [inline] BUG: KASAN: slab-use-after-free in dev_net include/linux/netdevice.h:2722 [inline] BUG: KASAN: slab-use-after-free in nf_hook_entry_head+0x1f1/0x2c0 net/netfilter/core.c:319 Read of size 8 at addr ffff888078cec108 by task kworker/u8:29/7402 CPU: 1 UID: 0 PID: 7402 Comm: kworker/u8:29 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: netns cleanup_net Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 read_pnet include/net/net_namespace.h:414 [inline] dev_net include/linux/netdevice.h:2722 [inline] nf_hook_entry_head+0x1f1/0x2c0 net/netfilter/core.c:319 __nf_unregister_net_hook+0x74/0x700 net/netfilter/core.c:491 nft_unregister_flowtable_ops net/netfilter/nf_tables_api.c:8979 [inline] __nft_unregister_flowtable_net_hooks net/netfilter/nf_tables_api.c:8994 [inline] __nft_release_hook+0x180/0x350 net/netfilter/nf_tables_api.c:11987 __nft_release_hooks net/netfilter/nf_tables_api.c:12001 [inline] nf_tables_pre_exit_net+0xa7/0x110 net/netfilter/nf_tables_api.c:12152 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0x990 net/core/net_namespace.c:234 cleanup_net+0x4d8/0x820 net/core/net_namespace.c:696 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 7120: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5627 [inline] __kmalloc_node_track_caller_noprof+0x568/0x800 mm/slub.c:5736 __do_krealloc mm/slub.c:6960 [inline] krealloc_node_align_noprof+0x140/0x390 mm/slub.c:7019 copy_array+0x71/0x100 kernel/bpf/verifier.c:1364 copy_stack_state kernel/bpf/verifier.c:1424 [inline] copy_func_state kernel/bpf/verifier.c:1705 [inline] copy_verifier_state+0x993/0xf80 kernel/bpf/verifier.c:1751 push_stack+0x19d/0x390 kernel/bpf/verifier.c:2104 check_cond_jmp_op+0x17de/0x2d50 kernel/bpf/verifier.c:16834 do_check_insn kernel/bpf/verifier.c:19929 [inline] do_check+0x5ac2/0xee10 kernel/bpf/verifier.c:20069 do_check_common+0x1938/0x24e0 kernel/bpf/verifier.c:23259 do_check_main kernel/bpf/verifier.c:23342 [inline] bpf_check+0x183de/0x1d720 kernel/bpf/verifier.c:24647 bpf_prog_load+0x13ba/0x19e0 kernel/bpf/syscall.c:3062 __sys_bpf+0x507/0x860 kernel/bpf/syscall.c:6134 __do_sys_bpf kernel/bpf/syscall.c:6244 [inline] __se_sys_bpf kernel/bpf/syscall.c:6242 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6242 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7120: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2523 [inline] slab_free mm/slub.c:6611 [inline] kfree+0x19a/0x6d0 mm/slub.c:6818 free_func_state kernel/bpf/verifier.c:1641 [inline] free_verifier_state+0xa7/0x230 kernel/bpf/verifier.c:1658 pop_stack kernel/bpf/verifier.c:2067 [inline] do_check+0x7ff8/0xee10 kernel/bpf/verifier.c:20118 do_check_common+0x1938/0x24e0 kernel/bpf/verifier.c:23259 do_check_main kernel/bpf/verifier.c:23342 [inline] bpf_check+0x183de/0x1d720 kernel/bpf/verifier.c:24647 bpf_prog_load+0x13ba/0x19e0 kernel/bpf/syscall.c:3062 __sys_bpf+0x507/0x860 kernel/bpf/syscall.c:6134 __do_sys_bpf kernel/bpf/syscall.c:6244 [inline] __se_sys_bpf kernel/bpf/syscall.c:6242 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6242 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888078cec000 which belongs to the cache kmalloc-cg-8k of size 8192 The buggy address is located 264 bytes inside of freed 8192-byte region [ffff888078cec000, ffff888078cee000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888078cec000 pfn:0x78ce8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807634bb41 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a030640 0000000000000000 0000000000000001 raw: ffff888078cec000 0000000000020001 00000000f5000000 ffff88807634bb41 head: 00fff00000000040 ffff88801a030640 0000000000000000 0000000000000001 head: ffff888078cec000 0000000000020001 00000000f5000000 ffff88807634bb41 head: 00fff00000000003 ffffea0001e33a01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6276, tgid 6275 (syz.0.90), ts 108597812860, free_ts 108541583858 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3039 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3212 new_slab mm/slub.c:3266 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4636 __slab_alloc+0x65/0x100 mm/slub.c:4755 __slab_alloc_node mm/slub.c:4831 [inline] slab_alloc_node mm/slub.c:5253 [inline] __do_kmalloc_node mm/slub.c:5626 [inline] __kmalloc_node_track_caller_noprof+0x5c7/0x800 mm/slub.c:5736 __do_krealloc mm/slub.c:6960 [inline] krealloc_node_align_noprof+0x140/0x390 mm/slub.c:7019 copy_array+0x71/0x100 kernel/bpf/verifier.c:1364 copy_stack_state kernel/bpf/verifier.c:1424 [inline] copy_func_state kernel/bpf/verifier.c:1705 [inline] copy_verifier_state+0x993/0xf80 kernel/bpf/verifier.c:1751 is_state_visited kernel/bpf/verifier.c:19628 [inline] do_check+0x4f98/0xee10 kernel/bpf/verifier.c:19999 do_check_common+0x1938/0x24e0 kernel/bpf/verifier.c:23259 do_check_main kernel/bpf/verifier.c:23342 [inline] bpf_check+0x183de/0x1d720 kernel/bpf/verifier.c:24647 bpf_prog_load+0x13ba/0x19e0 kernel/bpf/syscall.c:3062 __sys_bpf+0x507/0x860 kernel/bpf/syscall.c:6134 page last free pid 6273 tgid 6273 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 discard_slab mm/slub.c:3310 [inline] __put_partials+0x146/0x170 mm/slub.c:3857 put_cpu_partial+0x1f2/0x2e0 mm/slub.c:3932 __slab_free+0x2b9/0x390 mm/slub.c:5906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4955 [inline] slab_alloc_node mm/slub.c:5265 [inline] kmem_cache_alloc_noprof+0x367/0x6e0 mm/slub.c:5272 getname_flags+0xb8/0x540 fs/namei.c:146 getname include/linux/fs.h:2922 [inline] __do_sys_symlinkat fs/namei.c:4859 [inline] __se_sys_symlinkat fs/namei.c:4856 [inline] __x64_sys_symlinkat+0x7a/0xb0 fs/namei.c:4856 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888078cec000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078cec080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078cec100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078cec180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078cec200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================