================================================================== BUG: KASAN: slab-use-after-free in snapshot_ctr+0x586/0x1350 drivers/md/dm-snap.c:1288 Read of size 8 at addr ffff8881185c1998 by task syz.1.340/1525 CPU: 0 UID: 0 PID: 1525 Comm: syz.1.340 Not tainted syzkaller #0 c6d530d213d6421e3ceaeda0202ca36fa97e3e13 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:94 dump_stack_lvl+0x140/0x1c0 lib/dump_stack.c:120 print_address_description+0x71/0x210 mm/kasan/report.c:377 print_report+0x4a/0x70 mm/kasan/report.c:481 kasan_report+0x162/0x1a0 mm/kasan/report.c:594 __asan_report_load8_noabort+0x18/0x20 mm/kasan/report_generic.c:381 snapshot_ctr+0x586/0x1350 drivers/md/dm-snap.c:1288 dm_table_add_target+0x59c/0xcb0 drivers/md/dm-table.c:760 populate_table drivers/md/dm-ioctl.c:1494 [inline] table_load+0x2eb/0x7d0 drivers/md/dm-ioctl.c:1536 ctl_ioctl drivers/md/dm-ioctl.c:2107 [inline] dm_ctl_ioctl+0x8f3/0xde0 drivers/md/dm-ioctl.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0x126/0x1b0 fs/ioctl.c:892 __x64_sys_ioctl+0x7f/0xa0 fs/ioctl.c:892 x64_sys_call+0x1878/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f43c839fb19 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:00007f43c6df7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f43c8626090 RCX: 00007f43c839fb19 RDX: 0000200000000700 RSI: 00000000c138fd09 RDI: 0000000000000004 RBP: 00007f43c8437af8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f43c8626128 R14: 00007f43c8626090 R15: 00007fff648ff338 Allocated by task 1525: kasan_save_stack mm/kasan/common.c:49 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:70 kasan_save_alloc_info+0x3a/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x96/0xb0 mm/kasan/common.c:396 kasan_kmalloc include/linux/kasan.h:261 [inline] __kmalloc_cache_node_noprof+0x225/0x430 mm/slub.c:4440 kmalloc_node_noprof include/linux/slab.h:1004 [inline] open_table_device drivers/md/dm.c:758 [inline] dm_get_table_device+0x1e3/0x6c0 drivers/md/dm.c:837 dm_get_device+0x32b/0x7f0 drivers/md/dm-table.c:394 snapshot_ctr+0x292/0x1350 drivers/md/dm-snap.c:1273 dm_table_add_target+0x59c/0xcb0 drivers/md/dm-table.c:760 populate_table drivers/md/dm-ioctl.c:1494 [inline] table_load+0x2eb/0x7d0 drivers/md/dm-ioctl.c:1536 ctl_ioctl drivers/md/dm-ioctl.c:2107 [inline] dm_ctl_ioctl+0x8f3/0xde0 drivers/md/dm-ioctl.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0x126/0x1b0 fs/ioctl.c:892 __x64_sys_ioctl+0x7f/0xa0 fs/ioctl.c:892 x64_sys_call+0x1878/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 1525: kasan_save_stack mm/kasan/common.c:49 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:70 kasan_save_free_info+0x44/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:249 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:266 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2445 [inline] slab_free mm/slub.c:4716 [inline] kfree+0x158/0x440 mm/slub.c:4877 close_table_device drivers/md/dm.c:814 [inline] dm_put_table_device+0x298/0x2e0 drivers/md/dm.c:857 upgrade_mode drivers/md/dm-table.c:328 [inline] dm_get_device+0x571/0x7f0 drivers/md/dm-table.c:405 snapshot_ctr+0x435/0x1350 drivers/md/dm-snap.c:1283 dm_table_add_target+0x59c/0xcb0 drivers/md/dm-table.c:760 populate_table drivers/md/dm-ioctl.c:1494 [inline] table_load+0x2eb/0x7d0 drivers/md/dm-ioctl.c:1536 ctl_ioctl drivers/md/dm-ioctl.c:2107 [inline] dm_ctl_ioctl+0x8f3/0xde0 drivers/md/dm-ioctl.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0x126/0x1b0 fs/ioctl.c:892 __x64_sys_ioctl+0x7f/0xa0 fs/ioctl.c:892 x64_sys_call+0x1878/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the object at ffff8881185c1980 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff8881185c1980, ffff8881185c19e0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1185c1 anon flags: 0x4000000000000000(zone=1) page_type: f5(slab) raw: 4000000000000000 ffff888100041280 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000200020 00000001f5000000 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 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 295, tgid 295 (syz-executor), ts 30820771404, free_ts 30820664549 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook+0x37d/0x3b0 mm/page_alloc.c:1864 prep_new_page+0x2d/0x180 mm/page_alloc.c:1872 get_page_from_freelist+0x4aea/0x4ba0 mm/page_alloc.c:3949 __alloc_pages_noprof+0x35a/0x7e0 mm/page_alloc.c:5316 alloc_slab_page+0x6b/0x1e0 mm/slub.c:-1 allocate_slab+0x69/0x430 mm/slub.c:2687 new_slab mm/slub.c:2741 [inline] ___slab_alloc+0x591/0x8c0 mm/slub.c:3934 __slab_alloc mm/slub.c:4025 [inline] __slab_alloc_node mm/slub.c:4078 [inline] slab_alloc_node mm/slub.c:4241 [inline] __kmalloc_cache_node_noprof+0x2ae/0x430 mm/slub.c:4436 kmalloc_node_noprof include/linux/slab.h:1004 [inline] __get_vm_area_node+0x150/0x390 mm/vmalloc.c:3148 __vmalloc_node_range_noprof+0x340/0x1300 mm/vmalloc.c:3838 __vmalloc_node_noprof mm/vmalloc.c:3949 [inline] vzalloc_noprof+0x103/0x1d0 mm/vmalloc.c:4022 alloc_counters+0x75/0x520 net/ipv4/netfilter/ip_tables.c:799 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:821 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1020 [inline] do_ipt_get_ctl+0xab5/0x1210 net/ipv4/netfilter/ip_tables.c:1665 nf_getsockopt+0x28b/0x2b0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x15b/0x200 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x103/0x130 net/ipv4/tcp.c:4709 page last free pid 295 tgid 295 stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1391 [inline] free_unref_page+0xb99/0xf50 mm/page_alloc.c:2877 __free_pages+0x6b/0x3b0 mm/page_alloc.c:5403 vfree+0x3ea/0x5b0 mm/vmalloc.c:3410 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:723 [inline] get_entries net/ipv4/netfilter/arp_tables.c:877 [inline] do_arpt_get_ctl+0xdd3/0x10e0 net/ipv4/netfilter/arp_tables.c:1470 nf_getsockopt+0x28b/0x2b0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x15b/0x200 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x103/0x130 net/ipv4/tcp.c:4709 sock_common_getsockopt+0xaf/0xd0 net/core/sock.c:3847 do_sock_getsockopt+0x3a4/0x6c0 net/socket.c:2375 __sys_getsockopt net/socket.c:2404 [inline] __do_sys_getsockopt net/socket.c:2411 [inline] __se_sys_getsockopt net/socket.c:2408 [inline] __x64_sys_getsockopt+0x1aa/0x250 net/socket.c:2408 x64_sys_call+0x10db/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:56 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e Memory state around the buggy address: ffff8881185c1880: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8881185c1900: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff8881185c1980: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff8881185c1a00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8881185c1a80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ================================================================== Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] CPU: 0 UID: 0 PID: 1525 Comm: syz.1.340 Tainted: G B syzkaller #0 c6d530d213d6421e3ceaeda0202ca36fa97e3e13 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 RIP: 0010:bdev_get_queue include/linux/blkdev.h:1014 [inline] RIP: 0010:bdev_logical_block_size include/linux/blkdev.h:1368 [inline] RIP: 0010:dm_exception_store_set_chunk_size drivers/md/dm-exception-store.c:175 [inline] RIP: 0010:set_chunk_size drivers/md/dm-exception-store.c:158 [inline] RIP: 0010:dm_exception_store_create+0x6ea/0xa40 drivers/md/dm-exception-store.c:233 Code: 00 fc ff df 80 3c 08 00 74 08 4c 89 ff e8 7e e9 dd fd 4d 8b 3f 49 83 c7 18 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 58 e9 dd fd 41 bc b0 00 00 00 4d 03 RSP: 0018:ffffc9000ddd7840 EFLAGS: 00010206 RAX: 0000000000000003 RBX: ffff88811481c080 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881185c1998 RBP: ffffc9000ddd7910 R08: ffff88811f9c93c0 R09: 0000000000000002 R10: 0000000000000010 R11: 0000000000000002 R12: ffff888101ace420 R13: 1ffff92001bbaf10 R14: ffff888119274708 R15: 0000000000000018 FS: 00007f43c6df76c0(0000) GS:ffff8881f6c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fcb423f72f8 CR3: 000000011995a000 CR4: 00000000003526b0 DR0: 0000000000000008 DR1: 0000000000000007 DR2: 0000000000000004 DR3: 0000000000000034 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Call Trace: snapshot_ctr+0x674/0x1350 drivers/md/dm-snap.c:1294 dm_table_add_target+0x59c/0xcb0 drivers/md/dm-table.c:760 populate_table drivers/md/dm-ioctl.c:1494 [inline] table_load+0x2eb/0x7d0 drivers/md/dm-ioctl.c:1536 ctl_ioctl drivers/md/dm-ioctl.c:2107 [inline] dm_ctl_ioctl+0x8f3/0xde0 drivers/md/dm-ioctl.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0x126/0x1b0 fs/ioctl.c:892 __x64_sys_ioctl+0x7f/0xa0 fs/ioctl.c:892 x64_sys_call+0x1878/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f43c839fb19 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:00007f43c6df7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f43c8626090 RCX: 00007f43c839fb19 RDX: 0000200000000700 RSI: 00000000c138fd09 RDI: 0000000000000004 RBP: 00007f43c8437af8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f43c8626128 R14: 00007f43c8626090 R15: 00007fff648ff338 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bdev_get_queue include/linux/blkdev.h:1014 [inline] RIP: 0010:bdev_logical_block_size include/linux/blkdev.h:1368 [inline] RIP: 0010:dm_exception_store_set_chunk_size drivers/md/dm-exception-store.c:175 [inline] RIP: 0010:set_chunk_size drivers/md/dm-exception-store.c:158 [inline] RIP: 0010:dm_exception_store_create+0x6ea/0xa40 drivers/md/dm-exception-store.c:233 Code: 00 fc ff df 80 3c 08 00 74 08 4c 89 ff e8 7e e9 dd fd 4d 8b 3f 49 83 c7 18 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 58 e9 dd fd 41 bc b0 00 00 00 4d 03 RSP: 0018:ffffc9000ddd7840 EFLAGS: 00010206 RAX: 0000000000000003 RBX: ffff88811481c080 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8881185c1998 RBP: ffffc9000ddd7910 R08: ffff88811f9c93c0 R09: 0000000000000002 R10: 0000000000000010 R11: 0000000000000002 R12: ffff888101ace420 R13: 1ffff92001bbaf10 R14: ffff888119274708 R15: 0000000000000018 FS: 00007f43c6df76c0(0000) GS:ffff8881f6c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f43c6dd6d58 CR3: 000000011995a000 CR4: 00000000003526b0 DR0: 0000000000000008 DR1: 0000000000000007 DR2: 0000000000000004 DR3: 0000000000000034 DR6: 00000000ffff0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 fc add %bh,%ah 2: ff lcall (bad) 3: df 80 3c 08 00 74 filds 0x7400083c(%rax) 9: 08 4c 89 ff or %cl,-0x1(%rcx,%rcx,4) d: e8 7e e9 dd fd call 0xfddde990 12: 4d 8b 3f mov (%r15),%r15 15: 49 83 c7 18 add $0x18,%r15 19: 4c 89 f8 mov %r15,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 27: fc ff df * 2a: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping instruction 2e: 74 08 je 0x38 30: 4c 89 ff mov %r15,%rdi 33: e8 58 e9 dd fd call 0xfddde990 38: 41 bc b0 00 00 00 mov $0xb0,%r12d 3e: 4d rex.WRB 3f: 03 .byte 0x3