==================================================================
BUG: KASAN: slab-use-after-free in snapshot_ctr+0x5cb/0x1340
Read of size 8 at addr ffff8881120a5d18 by task syz.3.366/8053

CPU: 0 UID: 0 PID: 8053 Comm: syz.3.366 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_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 snapshot_ctr+0x5cb/0x1340
 dm_table_add_target+0x58d/0xc70
 table_load+0x325/0x8a0
 dm_ctl_ioctl+0x9ec/0xe10
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f79c49a8f19
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:00007f79c57f8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f79c4c25fa0 RCX: 00007f79c49a8f19
RDX: 0000200000000480 RSI: 00000000c138fd09 RDI: 0000000000000007
RBP: 00007f79c4a37f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f79c4c26038 R14: 00007f79c4c25fa0 R15: 00007ffd89f0bc38
 </TASK>

Allocated by task 8053:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_node_noprof+0x3cc/0x620
 dm_get_table_device+0x23e/0x730
 dm_get_device+0x327/0x760
 snapshot_ctr+0x2b2/0x1340
 dm_table_add_target+0x58d/0xc70
 table_load+0x325/0x8a0
 dm_ctl_ioctl+0x9ec/0xe10
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 8053:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x40/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c5/0x650
 dm_put_table_device+0x255/0x2a0
 dm_get_device+0x56f/0x760
 snapshot_ctr+0x471/0x1340
 dm_table_add_target+0x58d/0xc70
 table_load+0x325/0x8a0
 dm_ctl_ioctl+0x9ec/0xe10
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff8881120a5d00
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 24 bytes inside of
 freed 96-byte region [ffff8881120a5d00, ffff8881120a5d60)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1120a5
flags: 0x17ff00000000000(node=0|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 017ff00000000000 ffff888100041280 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000200020 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1116, tgid 1116 (kworker/u9:5), ts 14399617957
 post_alloc_hook+0x1f9/0x250
 get_page_from_freelist+0x2224/0x2290
 __alloc_frozen_pages_noprof+0x1fe/0x410
 allocate_slab+0x7d/0x5e0
 refill_objects+0x2d5/0x350
 __pcs_replace_empty_main+0x2c8/0x6c0
 __kmalloc_noprof+0x476/0x710
 security_task_alloc+0x4d/0x330
 copy_process+0x1c75/0x4510
 kernel_clone+0x2d7/0x940
 user_mode_thread+0x115/0x180
 call_usermodehelper_exec_work+0x5c/0x230
 process_scheduled_works+0xc3d/0x1630
 worker_thread+0xa47/0xfb0
 kthread+0x38b/0x480
 ret_from_fork+0x514/0xb70
page last free pid 1116 tgid 1116 ts 14399510953 stack trace:
 __free_frozen_pages+0xc97/0xd90
 __kasan_populate_vmalloc+0x12d/0x1c0
 alloc_vmap_area+0xd10/0x1410
 __get_vm_area_node+0x200/0x2f0
 __vmalloc_node_range_noprof+0x36e/0x16f0
 __vmalloc_node_noprof+0xc2/0x100
 dup_task_struct+0x2c6/0xa00
 copy_process+0x7ea/0x4510
 kernel_clone+0x2d7/0x940
 user_mode_thread+0x115/0x180
 call_usermodehelper_exec_work+0x5c/0x230
 process_scheduled_works+0xc3d/0x1630
 worker_thread+0xa47/0xfb0
 kthread+0x38b/0x480
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

Memory state around the buggy address:
 ffff8881120a5c00: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff8881120a5c80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
>ffff8881120a5d00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                            ^
 ffff8881120a5d80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff8881120a5e00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================
