================================================================== BUG: KASAN: use-after-free in pool_ctr+0x77c/0xbf8 drivers/md/dm-thin.c:3344 Read of size 8 at addr ffff0000f812d818 by task syz.3.7/4453 CPU: 1 PID: 4453 Comm: syz.3.7 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 print_address_description+0x88/0x218 mm/kasan/report.c:316 print_report+0x50/0x68 mm/kasan/report.c:420 kasan_report+0xa8/0xfc mm/kasan/report.c:524 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 pool_ctr+0x77c/0xbf8 drivers/md/dm-thin.c:3344 dm_table_add_target+0x4a4/0xb04 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x26c/0x690 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xaac/0xf1c drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:656 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 Allocated by task 4453: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_node_trace+0x78/0x90 mm/slab_common.c:1043 kmalloc_node include/linux/slab.h:585 [inline] open_table_device drivers/md/dm.c:723 [inline] dm_get_table_device+0x1f0/0x5a8 drivers/md/dm.c:792 dm_get_device+0x32c/0x6c4 drivers/md/dm-table.c:381 pool_ctr+0x464/0xbf8 drivers/md/dm-thin.c:3310 dm_table_add_target+0x4a4/0xb04 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x26c/0x690 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xaac/0xf1c drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:656 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 Freed by task 4453: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:237 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:245 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1735 [inline] slab_free_freelist_hook+0x16c/0x1e8 mm/slub.c:1761 slab_free mm/slub.c:3694 [inline] __kmem_cache_free+0xbc/0x21c mm/slub.c:3707 kfree+0xd0/0x1a8 mm/slab_common.c:988 close_table_device drivers/md/dm.c:769 [inline] dm_put_table_device+0x210/0x29c drivers/md/dm.c:812 upgrade_mode drivers/md/dm-table.c:326 [inline] dm_get_device+0x508/0x6c4 drivers/md/dm-table.c:391 pool_ctr+0x524/0xbf8 drivers/md/dm-thin.c:3317 dm_table_add_target+0x4a4/0xb04 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x26c/0x690 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xaac/0xf1c drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:656 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:589 The buggy address belongs to the object at ffff0000f812d800 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff0000f812d800, ffff0000f812d880) The buggy address belongs to the physical page: page:00000000701655e8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13812d flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000000200 0000000000000000 dead000000000122 ffff0000c0002300 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f812d700: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ffff0000f812d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000f812d800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f812d880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000f812d900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== device-mapper: table: 248:0: device 1:7 not in table devices list device-mapper: table: 248:0: thin-pool: Error creating metadata object (-EPERM) device-mapper: ioctl: error adding target to table device-mapper: table: 248:0: dm_table_destroy: dm_put_device call missing for 1:7