==================================================================
BUG: KASAN: slab-use-after-free in nft_array_get_cmp+0x246/0x2a0
Read of size 1 at addr ffff888172dd5619 by task syz.4.71119/22977

CPU: 0 UID: 0 PID: 22977 Comm: syz.4.71119 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:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_report+0xba/0x230
 kasan_report+0x117/0x150
 nft_array_get_cmp+0x246/0x2a0
 bsearch+0x50/0xc0
 nft_rbtree_get+0x16b/0x400
 nft_get_set_elem+0x420/0xaa0
 nf_tables_getsetelem_reset+0x646/0xab0
 nfnetlink_rcv_msg+0x8ae/0x12c0
 netlink_rcv_skb+0x232/0x4b0
 nfnetlink_rcv+0x2c0/0x27b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x18f/0x1d0
 ____sys_sendmsg+0x589/0x8c0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f824139acb9
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:00007f82421cb028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f8241615fa0 RCX: 00007f824139acb9
RDX: 0000000000008000 RSI: 0000200000000100 RDI: 0000000000000008
RBP: 00007f8241408bf7 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8241616038 R14: 00007f8241615fa0 R15: 00007fff1d2180d8
 </TASK>

Allocated by task 18528:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_noprof+0x35c/0x760
 nft_set_elem_init+0xa8/0x7e0
 nf_tables_newsetelem+0x22a2/0x42f0
 nfnetlink_rcv+0x1240/0x27b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x18f/0x1d0
 ____sys_sendmsg+0x589/0x8c0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 21999:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c1/0x630
 nft_trans_gc_trans_free+0x519/0x6c0
 rcu_core+0x7cd/0x1070
 handle_softirqs+0x22a/0x870
 __irq_exit_rcu+0x5f/0x150
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 asm_sysvec_apic_timer_interrupt+0x1a/0x20

The buggy address belongs to the object at ffff888172dd5600
 which belongs to the cache kmalloc-cg-64 of size 64
The buggy address is located 25 bytes inside of
 freed 64-byte region [ffff888172dd5600, ffff888172dd5640)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888172dd5600 pfn:0x172dd5
memcg:ffff888172dd5051
flags: 0x57ff00000000200(workingset|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000200 ffff888100056c80 ffffea0006ec9cd0 ffffea0005c04310
raw: ffff888172dd5600 000000800020001f 00000000f5000000 ffff888172dd5051
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 32635, tgid 32634 (syz.4.41954), ts 2250144939234, free_ts 2244954027500
 post_alloc_hook+0x231/0x280
 get_page_from_freelist+0x24dc/0x2580
 __alloc_frozen_pages_noprof+0x18d/0x380
 allocate_slab+0x7b/0x660
 refill_objects+0x331/0x3c0
 __pcs_replace_empty_main+0x2b9/0x620
 __kmalloc_cache_noprof+0x392/0x660
 nf_flow_offload_xdp_setup+0x7e/0x690
 nf_flow_table_offload_setup+0x122/0x690
 nft_register_flowtable_net_hooks+0x351/0x800
 nf_tables_newflowtable+0x1b44/0x23c0
 nfnetlink_rcv+0x1240/0x27b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x18f/0x1d0
 ____sys_sendmsg+0x589/0x8c0
page last free pid 15 tgid 15 stack trace:
 __free_frozen_pages+0xbb9/0xd10
 tlb_remove_table_rcu+0x85/0x100
 rcu_core+0x7cd/0x1070
 handle_softirqs+0x22a/0x870
 run_ksoftirqd+0x36/0x60
 smpboot_thread_fn+0x541/0xa50
 kthread+0x388/0x470
 ret_from_fork+0x51e/0xb90
 ret_from_fork_asm+0x1a/0x30

Memory state around the buggy address:
 ffff888172dd5500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888172dd5580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff888172dd5600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                            ^
 ffff888172dd5680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888172dd5700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
