==================================================================
BUG: KASAN: slab-use-after-free in nft_array_get_cmp+0x1f6/0x2a0
Read of size 1 at addr ffff88802d26d199 by task syz.0.4707/23860

CPU: 1 UID: 0 PID: 23860 Comm: syz.0.4707 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+0x1f6/0x2a0
 bsearch+0x50/0xc0
 nft_rbtree_get+0x16b/0x400
 nft_get_set_elem+0x420/0xaa0
 nf_tables_getsetelem+0x448/0x5e0
 nfnetlink_rcv_msg+0x8ae/0x12c0
 netlink_rcv_skb+0x232/0x4b0
 nfnetlink_rcv+0x2c0/0x27b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 __sock_sendmsg+0x21c/0x270
 ____sys_sendmsg+0x4d7/0x810
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0xe2/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fddb6f9acb9
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:00007fddb7ef3028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fddb7216090 RCX: 00007fddb6f9acb9
RDX: 0000000000008000 RSI: 0000200000000100 RDI: 0000000000000005
RBP: 00007fddb7008bf7 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fddb7216128 R14: 00007fddb7216090 R15: 00007ffc487b4078
 </TASK>

Allocated by task 23733:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_noprof+0x40c/0x7e0
 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+0x21c/0x270
 ____sys_sendmsg+0x4d7/0x810
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0xe2/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 26:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1be/0x650
 nft_trans_gc_trans_free+0x519/0x6c0
 rcu_core+0xc9e/0x1750
 handle_softirqs+0x22a/0x7c0
 __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 ffff88802d26d180
 which belongs to the cache kmalloc-cg-64 of size 64
The buggy address is located 25 bytes inside of
 freed 64-byte region [ffff88802d26d180, ffff88802d26d1c0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d26d
memcg:ffff888111be4001
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff888100049c80 ffffea0005c4db00 dead000000000004
raw: 0000000000000000 0000000000200020 00000000f5000000 ffff888111be4001
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 20591, tgid 20590 (syz.0.3862), ts 331243442503, free_ts 304502065159
 post_alloc_hook+0x228/0x280
 get_page_from_freelist+0x24dc/0x2580
 __alloc_frozen_pages_noprof+0x18d/0x380
 alloc_pages_mpol+0x232/0x4a0
 allocate_slab+0x86/0x3a0
 ___slab_alloc+0xd82/0x1760
 __slab_alloc+0x65/0x100
 __kmalloc_node_track_caller_noprof+0x5b7/0x7f0
 krealloc_node_align_noprof+0x1ae/0x390
 push_jmp_history+0x1cc/0x690
 do_check+0x4866/0xec30
 do_check_common+0x19cc/0x25b0
 bpf_check+0x5f0d/0x1c4a0
 bpf_prog_load+0x1484/0x1ae0
 __sys_bpf+0x570/0x920
 __x64_sys_bpf+0x7c/0x90
page last free pid 18870 tgid 18869 stack trace:
 __free_frozen_pages+0xbb0/0xd10
 __slab_free+0x2ce/0x320
 qlist_free_all+0x97/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_node_track_caller_noprof+0x511/0x7f0
 kstrdup+0x42/0x100
 __kernfs_new_node+0xa9/0x8e0
 kernfs_new_node+0x102/0x210
 kernfs_create_dir_ns+0x44/0x130
 sysfs_create_dir_ns+0x12f/0x2a0
 kobject_add_internal+0x62b/0xd00
 kobject_init_and_add+0x12b/0x1a0
 net_rx_queue_update_kobjects+0x221/0x740
 netdev_register_kobject+0x21f/0x310
 register_netdevice+0x12a3/0x1ae0

Memory state around the buggy address:
 ffff88802d26d080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88802d26d100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88802d26d180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                            ^
 ffff88802d26d200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88802d26d280: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
==================================================================
