================================================================== BUG: KASAN: slab-use-after-free in nft_set_ext include/net/netfilter/nf_tables.h:795 [inline] BUG: KASAN: slab-use-after-free in nft_set_ext_key include/net/netfilter/nf_tables.h:800 [inline] BUG: KASAN: slab-use-after-free in nft_array_get_cmp+0x1f6/0x2a0 net/netfilter/nft_set_rbtree.c:133 Read of size 1 at addr ffff88806954ea19 by task syz.2.380/6443 CPU: 0 UID: 0 PID: 6443 Comm: syz.2.380 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/13/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 nft_set_ext include/net/netfilter/nf_tables.h:795 [inline] nft_set_ext_key include/net/netfilter/nf_tables.h:800 [inline] nft_array_get_cmp+0x1f6/0x2a0 net/netfilter/nft_set_rbtree.c:133 __inline_bsearch include/linux/bsearch.h:15 [inline] bsearch+0x50/0xc0 lib/bsearch.c:33 nft_rbtree_get+0x16b/0x400 net/netfilter/nft_set_rbtree.c:169 nft_setelem_get net/netfilter/nf_tables_api.c:6495 [inline] nft_get_set_elem+0x420/0xaa0 net/netfilter/nf_tables_api.c:6543 nf_tables_getsetelem+0x448/0x5e0 net/netfilter/nf_tables_api.c:6632 nfnetlink_rcv_msg+0x8ae/0x12c0 net/netfilter/nfnetlink.c:290 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2550 nfnetlink_rcv+0x2c0/0x27b0 net/netfilter/nfnetlink.c:669 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec+0x18f/0x1d0 net/socket.c:737 __sock_sendmsg net/socket.c:752 [inline] ____sys_sendmsg+0x589/0x8c0 net/socket.c:2610 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2664 __sys_sendmsg net/socket.c:2696 [inline] __do_sys_sendmsg net/socket.c:2701 [inline] __se_sys_sendmsg net/socket.c:2699 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2699 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb50d79aeb9 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:00007fff8df94fb8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fb50da15fa0 RCX: 00007fb50d79aeb9 RDX: 0000000000008000 RSI: 0000200000000100 RDI: 0000000000000004 RBP: 00007fb50d808c1f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb50da15fac R14: 00007fb50da15fa0 R15: 00007fb50da15fa0 Allocated by task 6443: 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] __do_kmalloc_node mm/slub.c:5170 [inline] __kmalloc_noprof+0x35c/0x760 mm/slub.c:5182 kmalloc_noprof include/linux/slab.h:966 [inline] kzalloc_noprof include/linux/slab.h:1204 [inline] nft_set_elem_init+0xa8/0x7e0 net/netfilter/nf_tables_api.c:6811 nft_add_set_elem net/netfilter/nf_tables_api.c:7547 [inline] nf_tables_newsetelem+0x22a4/0x4360 net/netfilter/nf_tables_api.c:7717 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:526 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:649 [inline] nfnetlink_rcv+0x1240/0x27b0 net/netfilter/nfnetlink.c:667 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec+0x18f/0x1d0 net/socket.c:737 __sock_sendmsg net/socket.c:752 [inline] ____sys_sendmsg+0x589/0x8c0 net/socket.c:2610 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2664 __sys_sendmsg net/socket.c:2696 [inline] __do_sys_sendmsg net/socket.c:2701 [inline] __se_sys_sendmsg net/socket.c:2699 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2699 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15: 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:2667 [inline] slab_free mm/slub.c:6075 [inline] kfree+0x1c1/0x610 mm/slub.c:6388 nf_tables_set_elem_destroy net/netfilter/nf_tables_api.c:6930 [inline] nft_trans_gc_trans_free+0x519/0x6c0 net/netfilter/nf_tables_api.c:10542 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 handle_softirqs+0x22a/0x7c0 kernel/softirq.c:626 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1067 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51b/0xa40 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 ffff88806954ea00 which belongs to the cache kmalloc-cg-64 of size 64 The buggy address is located 25 bytes inside of freed 64-byte region [ffff88806954ea00, ffff88806954ea40) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6954e memcg:ffff88806954e051 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88813ff3bc80 dead000000000100 dead000000000122 raw: 0000000000000000 0000008000200020 00000000f5000000 ffff88806954e051 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 12, tgid 12 (kworker/u8:0), ts 209286605307, free_ts 209274621324 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1883 prep_new_page mm/page_alloc.c:1891 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3956 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5244 alloc_slab_page mm/slub.c:3235 [inline] allocate_slab+0x7b/0x660 mm/slub.c:3408 new_slab mm/slub.c:3466 [inline] refill_objects+0x33a/0x3d0 mm/slub.c:7077 refill_sheaf mm/slub.c:2784 [inline] __pcs_replace_empty_main+0x2b9/0x620 mm/slub.c:4529 alloc_from_pcs mm/slub.c:4632 [inline] slab_alloc_node mm/slub.c:4766 [inline] __do_kmalloc_node mm/slub.c:5169 [inline] __kvmalloc_node_noprof+0x657/0x8a0 mm/slub.c:6657 allocate_hook_entries_size net/netfilter/core.c:58 [inline] __nf_hook_entries_try_shrink+0x328/0x700 net/netfilter/core.c:257 __nf_unregister_net_hook+0x4cc/0x6f0 net/netfilter/core.c:517 nf_unregister_net_hook net/netfilter/core.c:-1 [inline] nf_unregister_net_hooks+0xcb/0x140 net/netfilter/core.c:610 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0x940 net/core/net_namespace.c:234 cleanup_net+0x4df/0x7b0 net/core/net_namespace.c:696 process_one_work+0x949/0x15a0 kernel/workqueue.c:3279 process_scheduled_works kernel/workqueue.c:3362 [inline] worker_thread+0xb46/0x1140 kernel/workqueue.c:3443 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51b/0xa40 arch/x86/kernel/process.c:158 page last free pid 23 tgid 23 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1432 [inline] __free_frozen_pages+0xc01/0xd80 mm/page_alloc.c:2972 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 handle_softirqs+0x22a/0x7c0 kernel/softirq.c:626 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1067 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51b/0xa40 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: ffff88806954e900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88806954e980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88806954ea00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88806954ea80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88806954eb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================