==================================================================
BUG: KASAN: slab-use-after-free in mini_qdisc_pair_swap+0x174/0x190
Write of size 8 at addr ffff88816ae78ac8 by task syz.0.18353/6268

CPU: 0 UID: 0 PID: 6268 Comm: syz.0.18353 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-
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_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 mini_qdisc_pair_swap+0x174/0x190
 tcf_chain_tp_insert_unique+0x76a/0x970
 tc_new_tfilter+0x14bf/0x1900
 rtnetlink_rcv_msg+0x802/0xc00
 netlink_rcv_skb+0x226/0x4a0
 netlink_unicast+0x7bd/0x940
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x13a/0x180
 ____sys_sendmsg+0x54e/0x850
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1b1/0x290
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa62e79f559
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:00007fa62f6da028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fa62ea26180 RCX: 00007fa62e79f559
RDX: 0000000000000000 RSI: 0000200000000cc0 RDI: 0000000000000004
RBP: 00007fa62e836b20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa62ea26218 R14: 00007fa62ea26180 R15: 00007ffcafd016d8
 </TASK>

Allocated by task 6163:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_node_noprof+0x4b9/0x720
 qdisc_alloc+0x92/0x9d0
 qdisc_create+0x12c/0xf00
 tc_modify_qdisc+0x18cc/0x2390
 rtnetlink_rcv_msg+0x7b9/0xc00
 netlink_rcv_skb+0x226/0x4a0
 netlink_unicast+0x7bd/0x940
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x13a/0x180
 ____sys_sendmsg+0x54e/0x850
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1b1/0x290
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 15:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x40/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c5/0x650
 rcu_core+0x926/0x1260
 handle_softirqs+0x226/0x860
 run_ksoftirqd+0x36/0x60
 smpboot_thread_fn+0x565/0xa70
 kthread+0x38b/0x480
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 call_rcu+0xee/0x8b0
 qdisc_graft+0xcdd/0x1810
 tc_modify_qdisc+0x1968/0x2390
 rtnetlink_rcv_msg+0x7b9/0xc00
 netlink_rcv_skb+0x226/0x4a0
 netlink_unicast+0x7bd/0x940
 netlink_sendmsg+0x813/0xb40
 sock_sendmsg_nosec+0x13a/0x180
 ____sys_sendmsg+0x54e/0x850
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1b1/0x290
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88816ae78800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 712 bytes inside of
 freed 1024-byte region [ffff88816ae78800, ffff88816ae78c00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88816ae7f800 pfn:0x16ae78
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000240(workingset|head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000240 ffff888100041dc0 ffffea0006f91810 ffffea00069a3410
raw: ffff88816ae7f800 000000000010000f 00000000f5000000 0000000000000000
head: 057ff00000000240 ffff888100041dc0 ffffea0006f91810 ffffea00069a3410
head: ffff88816ae7f800 000000000010000f 00000000f5000000 0000000000000000
head: 057ff00000000003 fffffffffffffe01 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 5147, tgid 5147 (udevd), ts 23536018624
 post_alloc_hook+0x1f9/0x250
 get_page_from_freelist+0x2209/0x2280
 __alloc_frozen_pages_noprof+0x217/0x5a0
 allocate_slab+0x7d/0x620
 refill_objects+0x2d5/0x350
 __pcs_replace_empty_main+0x2c8/0x6c0
 __kmalloc_noprof+0x47b/0x720
 load_elf_binary+0x2c6/0x28d0
 bprm_execve+0x930/0x1590
 do_execveat_common+0x4f4/0x670
 __x64_sys_execve+0x97/0xc0
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5140 tgid 5140 ts 23379015772 stack trace:
 __free_frozen_pages+0xc93/0xd90
 __slab_free+0x274/0x2c0
 qlist_free_all+0x99/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_cache_noprof+0x29f/0x600
 tomoyo_find_next_domain+0xdf/0x1a90
 tomoyo_bprm_check_security+0x11b/0x180
 security_bprm_check+0x85/0x240
 bprm_execve+0x888/0x1590
 do_execveat_common+0x4f4/0x670
 __x64_sys_execve+0x97/0xc0
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88816ae78980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88816ae78a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88816ae78a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff88816ae78b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88816ae78b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
