================================================================== BUG: KASAN: use-after-free in pool_ctr+0x86a/0xd50 drivers/md/dm-thin.c:3344 Read of size 8 at addr ffff88802fc17398 by task syz.0.66/4643 CPU: 1 PID: 4643 Comm: syz.0.66 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x210 mm/kasan/report.c:420 kasan_report+0x10b/0x140 mm/kasan/report.c:524 pool_ctr+0x86a/0xd50 drivers/md/dm-thin.c:3344 dm_table_add_target+0x571/0xbc0 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x2ce/0x760 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff499da9b59 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:00007ff49ad04028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff49a035fa0 RCX: 00007ff499da9b59 RDX: 0000200000000d40 RSI: 00000000c138fd09 RDI: 0000000000000003 RBP: 00007ff499e3a18b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff49a036038 R14: 00007ff49a035fa0 R15: 00007fffb77b30c8 Allocated by task 4643: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384 kmalloc_node include/linux/slab.h:585 [inline] open_table_device drivers/md/dm.c:723 [inline] dm_get_table_device+0x240/0x660 drivers/md/dm.c:792 dm_get_device+0x3c3/0x7f0 drivers/md/dm-table.c:381 pool_ctr+0x4a8/0xd50 drivers/md/dm-thin.c:3310 dm_table_add_target+0x571/0xbc0 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x2ce/0x760 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 4643: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1735 [inline] slab_free_freelist_hook+0x133/0x1b0 mm/slub.c:1761 slab_free mm/slub.c:3694 [inline] __kmem_cache_free+0xb6/0x200 mm/slub.c:3707 close_table_device drivers/md/dm.c:769 [inline] dm_put_table_device+0x223/0x270 drivers/md/dm.c:812 upgrade_mode drivers/md/dm-table.c:326 [inline] dm_get_device+0x61e/0x7f0 drivers/md/dm-table.c:391 pool_ctr+0x57f/0xd50 drivers/md/dm-thin.c:3317 dm_table_add_target+0x571/0xbc0 drivers/md/dm-table.c:733 populate_table drivers/md/dm-ioctl.c:1454 [inline] table_load+0x2ce/0x760 drivers/md/dm-ioctl.c:1496 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88802fc17380 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 24 bytes inside of 64-byte region [ffff88802fc17380, ffff88802fc173c0) The buggy address belongs to the physical page: page:ffffea0000bf05c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2fc17 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888018441640 raw: 0000000000000000 0000000080200020 00000001ffffffff 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 4642, tgid 4641 (syz.1.67), ts 95496479984, free_ts 95379946019 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2561 prep_new_page mm/page_alloc.c:2568 [inline] get_page_from_freelist+0x208b/0x21a0 mm/page_alloc.c:4368 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5668 alloc_slab_page+0x5d/0x180 mm/slub.c:1805 allocate_slab mm/slub.c:1950 [inline] new_slab+0x87/0x2d0 mm/slub.c:2003 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3161 __slab_alloc mm/slub.c:3247 [inline] slab_alloc_node mm/slub.c:3332 [inline] __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3405 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] sctp_add_bind_addr+0x89/0x350 net/sctp/bind_addr.c:150 sctp_copy_local_addr_list+0x317/0x4d0 net/sctp/protocol.c:165 sctp_bind_addr_copy+0xaf/0x3c0 net/sctp/bind_addr.c:56 sctp_sf_do_unexpected_init+0xb47/0x1320 net/sctp/sm_statefuns.c:1629 sctp_do_sm+0x245/0x5690 net/sctp/sm_sideeffect.c:1174 sctp_assoc_bh_rcv+0x3fd/0x6f0 net/sctp/associola.c:1068 sctp_backlog_rcv+0x158/0x360 net/sctp/input.c:346 sk_backlog_rcv include/net/sock.h:1146 [inline] __release_sock+0x1cd/0x460 net/core/sock.c:2976 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1488 [inline] free_pcp_prepare mm/page_alloc.c:1538 [inline] free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3422 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3563 release_pages+0x20d1/0x2340 mm/swap.c:1035 tlb_batch_pages_flush mm/mmu_gather.c:60 [inline] tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu+0x105/0x220 mm/mmu_gather.c:262 tlb_finish_mmu+0xf0/0x220 mm/mmu_gather.c:394 exit_mmap+0x388/0x970 mm/mmap.c:3313 __mmput+0x118/0x3a0 kernel/fork.c:1204 exit_mm+0x24d/0x350 kernel/exit.c:572 do_exit+0x958/0x2570 kernel/exit.c:874 do_group_exit+0x229/0x2e0 kernel/exit.c:1030 get_signal+0x1348/0x1440 kernel/signal.c:2897 arch_do_signal_or_restart+0xc4/0x1310 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213 __syscall_exit_to_user_mode_work kernel/entry/common.c:295 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:306 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82 Memory state around the buggy address: ffff88802fc17280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802fc17300: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88802fc17380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88802fc17400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88802fc17480: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ================================================================== page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 4642, tgid 4641 (syz.1.67), ts 95496479984, free_ts 95379946019 page last free stack trace: