================================================================== BUG: KASAN: slab-use-after-free in ptep_get include/linux/pgtable.h:340 [inline] BUG: KASAN: slab-use-after-free in filemap_map_folio_range mm/filemap.c:3624 [inline] BUG: KASAN: slab-use-after-free in filemap_map_pages+0x13e7/0x1680 mm/filemap.c:3740 Read of size 8 at addr ffff88802a73d000 by task syz.3.322/6985 CPU: 1 UID: 0 PID: 6985 Comm: syz.3.322 Not tainted 6.15.0-syzkaller-07774-g90b83efa6701 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xcd/0x680 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 ptep_get include/linux/pgtable.h:340 [inline] filemap_map_folio_range mm/filemap.c:3624 [inline] filemap_map_pages+0x13e7/0x1680 mm/filemap.c:3740 do_fault_around mm/memory.c:5476 [inline] do_read_fault mm/memory.c:5509 [inline] do_fault mm/memory.c:5652 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x390c/0x5450 mm/memory.c:6140 handle_mm_fault+0x3fe/0xad0 mm/memory.c:6309 faultin_page mm/gup.c:1193 [inline] __get_user_pages+0x570/0x3bb0 mm/gup.c:1491 populate_vma_page_range+0x278/0x3a0 mm/gup.c:1929 __mm_populate+0x1d8/0x380 mm/gup.c:2032 mm_populate include/linux/mm.h:3487 [inline] vm_mmap_pgoff+0x362/0x450 mm/util.c:584 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8fd338e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8fd4176038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f8fd35b5fa0 RCX: 00007f8fd338e969 RDX: 00000000027ffff7 RSI: 0000000000600000 RDI: 0000200000000000 RBP: 00007f8fd3410ab1 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000004012011 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8fd35b5fa0 R15: 00007ffe550068a8 Allocated by task 6438: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4203 dst_alloc+0x99/0x1a0 net/core/dst.c:89 ip6_dst_alloc net/ipv6/route.c:342 [inline] icmp6_dst_alloc+0x79/0x4f0 net/ipv6/route.c:3324 ndisc_send_skb+0x1372/0x1e40 net/ipv6/ndisc.c:493 ndisc_send_rs+0x129/0x670 net/ipv6/ndisc.c:723 addrconf_dad_completed+0x49d/0x10d0 net/ipv6/addrconf.c:4364 addrconf_dad_work+0x84d/0x14e0 net/ipv6/addrconf.c:4272 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 6650: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x2d1/0x4d0 mm/slub.c:4744 dst_destroy+0x2c2/0x3f0 net/core/dst.c:121 rcu_do_batch kernel/rcu/tree.c:2576 [inline] rcu_core+0x79c/0x14e0 kernel/rcu/tree.c:2832 handle_softirqs+0x219/0x8e0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:548 __call_rcu_common.constprop.0+0x9a/0x9f0 kernel/rcu/tree.c:3090 call_rcu_hurry include/linux/rcupdate.h:115 [inline] dst_release net/core/dst.c:177 [inline] dst_release+0x266/0x340 net/core/dst.c:165 refdst_drop include/net/dst.h:263 [inline] skb_dst_drop include/net/dst.h:275 [inline] __dev_queue_xmit+0x23e9/0x43e0 net/core/dev.c:4668 dev_queue_xmit include/linux/netdevice.h:3355 [inline] neigh_connected_output+0x3da/0x620 net/core/neighbour.c:1541 neigh_output include/net/neighbour.h:539 [inline] ip6_finish_output2+0xaee/0x2020 net/ipv6/ip6_output.c:141 __ip6_finish_output net/ipv6/ip6_output.c:215 [inline] ip6_finish_output+0x3f9/0x1360 net/ipv6/ip6_output.c:226 NF_HOOK_COND include/linux/netfilter.h:306 [inline] ip6_output+0x1f9/0x540 net/ipv6/ip6_output.c:247 dst_output include/net/dst.h:459 [inline] NF_HOOK include/linux/netfilter.h:317 [inline] ndisc_send_skb+0xa91/0x1e40 net/ipv6/ndisc.c:513 ndisc_send_rs+0x129/0x670 net/ipv6/ndisc.c:723 addrconf_dad_completed+0x49d/0x10d0 net/ipv6/addrconf.c:4364 addrconf_dad_work+0x84d/0x14e0 net/ipv6/addrconf.c:4272 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802a73d000 which belongs to the cache ip6_dst_cache of size 232 The buggy address is located 0 bytes inside of freed 232-byte region [ffff88802a73d000, ffff88802a73d0e8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802a73d000 pfn:0x2a73d flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff888030a39640 ffffea0000a34a10 ffffea0000c48250 raw: ffff88802a73d000 00000000000c0003 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5893, tgid 5893 (kworker/0:4), ts 115880984491, free_ts 115874165021 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1710 prep_new_page mm/page_alloc.c:1718 [inline] get_page_from_freelist+0x135c/0x3950 mm/page_alloc.c:3680 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4970 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab mm/slub.c:2618 [inline] new_slab+0x23b/0x330 mm/slub.c:2672 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948 __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_noprof+0xef/0x3b0 mm/slub.c:4203 dst_alloc+0x99/0x1a0 net/core/dst.c:89 ip6_dst_alloc net/ipv6/route.c:342 [inline] icmp6_dst_alloc+0x79/0x4f0 net/ipv6/route.c:3324 mld_sendpack+0x5a8/0x1220 net/ipv6/mcast.c:1857 mld_send_cr net/ipv6/mcast.c:2169 [inline] mld_ifc_work+0x740/0xca0 net/ipv6/mcast.c:2702 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1254 [inline] __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2717 pagetable_free include/linux/mm.h:3019 [inline] pagetable_dtor_free include/linux/mm.h:3117 [inline] __tlb_remove_table include/asm-generic/tlb.h:215 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x116/0x1a0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2576 [inline] rcu_core+0x79c/0x14e0 kernel/rcu/tree.c:2832 handle_softirqs+0x219/0x8e0 kernel/softirq.c:579 run_ksoftirqd kernel/softirq.c:968 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:960 smpboot_thread_fn+0x3f7/0xae0 kernel/smpboot.c:164 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88802a73cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a73cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802a73d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a73d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff88802a73d100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== page: refcount:33 mapcount:0 mapping:ffff88805547ede8 index:0x480 pfn:0x4f120 head: order:5 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880567ae000 aops:ext4_da_aops ino:f dentry name(?):"file1" flags: 0xfff60000000069(locked|uptodate|lru|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff60000000069 ffffea00013c3008 ffffea00013c5008 ffff88805547ede8 raw: 0000000000000480 0000000000000000 00000021ffffffff ffff8880567ae000 head: 00fff60000000069 ffffea00013c3008 ffffea00013c5008 ffff88805547ede8 head: 0000000000000480 0000000000000000 00000021ffffffff ffff8880567ae000 head: 00fff00000000205 ffffea00013c4801 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000020 page dumped because: VM_WARN_ON_FOLIO((_Generic((page + nr_pages - 1), const struct page *: (const struct folio *)_compound_head(page + nr_pages - 1), struct page *: (struct folio *)_compound_head(page + nr_pages - 1))) != folio) page_owner tracks the page as allocated page last allocated via order 5, migratetype Movable, gfp_mask 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_MOVABLE|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 6985, tgid 6984 (syz.3.322), ts 174435987587, free_ts 36222345950 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1710 prep_new_page mm/page_alloc.c:1718 [inline] get_page_from_freelist+0x135c/0x3950 mm/page_alloc.c:3680 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4970 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301 alloc_pages_noprof mm/mempolicy.c:2392 [inline] folio_alloc_noprof+0x20/0x2d0 mm/mempolicy.c:2402 filemap_alloc_folio_noprof+0x3a1/0x470 mm/filemap.c:1007 ractl_alloc_folio mm/readahead.c:186 [inline] ra_alloc_folio mm/readahead.c:441 [inline] page_cache_ra_order+0x4c0/0xd00 mm/readahead.c:509 page_cache_async_ra+0x5cb/0x8a0 mm/readahead.c:687 do_async_mmap_readahead mm/filemap.c:3290 [inline] filemap_fault+0xd47/0x2730 mm/filemap.c:3389 __do_fault+0x10d/0x490 mm/memory.c:5098 do_read_fault mm/memory.c:5518 [inline] do_fault mm/memory.c:5652 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x39fb/0x5450 mm/memory.c:6140 handle_mm_fault+0x3fe/0xad0 mm/memory.c:6309 faultin_page mm/gup.c:1193 [inline] __get_user_pages+0x570/0x3bb0 mm/gup.c:1491 populate_vma_page_range+0x278/0x3a0 mm/gup.c:1929 __mm_populate+0x1d8/0x380 mm/gup.c:2032 mm_populate include/linux/mm.h:3487 [inline] vm_mmap_pgoff+0x362/0x450 mm/util.c:584 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1254 [inline] __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2717 __free_pages mm/page_alloc.c:5082 [inline] free_contig_range+0x183/0x4b0 mm/page_alloc.c:6938 destroy_args+0x7f6/0xa60 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x13c4/0x2d90 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x123/0x6e0 init/main.c:1257 do_initcall_level init/main.c:1319 [inline] do_initcalls init/main.c:1335 [inline] do_basic_setup init/main.c:1354 [inline] kernel_init_freeable+0x5c2/0x900 init/main.c:1567 kernel_init+0x1c/0x2b0 init/main.c:1457 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 6985 at ./include/linux/rmap.h:427 __folio_rmap_sanity_checks+0x37e/0x680 include/linux/rmap.h:427 Modules linked in: CPU: 1 UID: 0 PID: 6985 Comm: syz.3.322 Tainted: G B 6.15.0-syzkaller-07774-g90b83efa6701 #0 PREEMPT(full) Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:__folio_rmap_sanity_checks+0x37e/0x680 include/linux/rmap.h:427 Code: 3d ae ff 49 8d 6f ff e8 b0 3d ae ff 48 39 dd 0f 84 47 fe ff ff e8 a2 3d ae ff 48 c7 c6 c0 b0 9b 8b 48 89 df e8 73 85 f6 ff 90 <0f> 0b 90 e9 2a fe ff ff e8 85 3d ae ff 49 89 ee 31 ff 41 81 e6 ff RSP: 0018:ffffc90004d07638 EFLAGS: 00010246 RAX: 0000000000080000 RBX: ffffea00013c4800 RCX: ffffc9000c18a000 RDX: 0000000000080000 RSI: ffffffff820d3a2d RDI: ffff888027064044 RBP: ffffea00013ca7c0 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 6f72665f74657220 R12: 0000000000000180 R13: 0000000000000000 R14: 0000000000000000 R15: dead000000000100 FS: 00007f8fd41766c0(0000) GS:ffff888124a7b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8fd4155d58 CR3: 00000000650a6000 CR4: 0000000000350ef0 Call Trace: __folio_add_rmap mm/rmap.c:1252 [inline] __folio_add_file_rmap mm/rmap.c:1620 [inline] folio_add_file_rmap_ptes+0x77/0x840 mm/rmap.c:1642 set_pte_range+0x14e/0x540 mm/memory.c:5256 filemap_map_folio_range mm/filemap.c:3631 [inline] filemap_map_pages+0xb48/0x1680 mm/filemap.c:3740 do_fault_around mm/memory.c:5476 [inline] do_read_fault mm/memory.c:5509 [inline] do_fault mm/memory.c:5652 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x390c/0x5450 mm/memory.c:6140 handle_mm_fault+0x3fe/0xad0 mm/memory.c:6309 faultin_page mm/gup.c:1193 [inline] __get_user_pages+0x570/0x3bb0 mm/gup.c:1491 populate_vma_page_range+0x278/0x3a0 mm/gup.c:1929 __mm_populate+0x1d8/0x380 mm/gup.c:2032 mm_populate include/linux/mm.h:3487 [inline] vm_mmap_pgoff+0x362/0x450 mm/util.c:584 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8fd338e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8fd4176038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f8fd35b5fa0 RCX: 00007f8fd338e969 RDX: 00000000027ffff7 RSI: 0000000000600000 RDI: 0000200000000000 RBP: 00007f8fd3410ab1 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000004012011 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8fd35b5fa0 R15: 00007ffe550068a8