==================================================================
BUG: KASAN: slab-use-after-free in bch2_copygc+0x105d/0x4510
Read of size 8 at addr ffff8881247901a0 by task bch-copygc/loop/8189

CPU: 0 UID: 0 PID: 8189 Comm: bch-copygc/loop 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+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 kasan_check_range+0x2b0/0x2c0
 bch2_copygc+0x105d/0x4510
 bch2_copygc_thread+0x97a/0xe00
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Allocated by task 8189:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kvmalloc_node_noprof+0x30d/0x5f0
 bch2_bucket_bitmap_set+0x9a/0x1d0
 check_bucket_backpointer_mismatch+0x1bdf/0x23a0
 bch2_check_bucket_backpointer_mismatch+0x36c/0x690
 __bch2_move_data_phys+0x17a7/0x1c50
 bch2_evacuate_bucket+0x228/0x3a0
 bch2_copygc+0x3be3/0x4510
 bch2_copygc_thread+0x97a/0xe00
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30

The buggy address belongs to the object at ffff8881247901a0
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
 freed 16-byte region [ffff8881247901a0, ffff8881247901b0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881247904a0 pfn:0x124790
flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000000 ffff88801a441640 dead000000000100 dead000000000122
raw: ffff8881247904a0 000000008080007f 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 95, tgid 95 (kworker/1:2), ts 159130063171, free_ts 157568694303
 register_dummy_stack+0x89/0xe0
 init_page_owner+0x2e/0x620
 page_ext_init+0x511/0x550
 mm_core_init+0x56/0x70
page last free pid 8121 tgid 8120 stack trace:
 __free_frozen_pages+0xbc4/0xd30
 vfree+0x25a/0x400
 btrfs_ioctl_logical_to_ino+0x21e/0x270
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888124790080: fa fb fc fc 00 01 fc fc 00 01 fc fc fa fb fc fc
 ffff888124790100: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
>ffff888124790180: fa fb fc fc fb fb fc fc fa fb fc fc fa fb fc fc
                               ^
 ffff888124790200: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
 ffff888124790280: 00 06 fc fc 00 05 fc fc 00 05 fc fc 00 01 fc fc
==================================================================
