================================================================== BUG: KASAN: use-after-free in dev_map_generic_redirect+0xa0/0x650 kernel/bpf/devmap.c:668 Read of size 8 at addr ffff8880632dba00 by task syz.7.4998/22593 CPU: 1 PID: 22593 Comm: syz.7.4998 Not tainted 6.1.116-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 dev_map_generic_redirect+0xa0/0x650 kernel/bpf/devmap.c:668 xdp_do_generic_redirect_map net/core/filter.c:4392 [inline] xdp_do_generic_redirect+0x4bf/0x850 net/core/filter.c:4451 do_xdp_generic+0x50b/0x6d0 net/core/dev.c:4955 __netif_receive_skb_core+0x1c88/0x41d0 net/core/dev.c:5357 __netif_receive_skb_one_core net/core/dev.c:5534 [inline] __netif_receive_skb+0x11c/0x530 net/core/dev.c:5650 netif_receive_skb_internal net/core/dev.c:5736 [inline] netif_receive_skb+0x1f4/0x890 net/core/dev.c:5795 tun_rx_batched+0x1b3/0x8e0 drivers/net/tun.c:1548 tun_get_user+0x2c03/0x42d0 drivers/net/tun.c:1998 tun_chr_write_iter+0x10c/0x1f0 drivers/net/tun.c:2044 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x857/0xbc0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f156897d1ff Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 c9 8d 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 1c 8e 02 00 48 RSP: 002b:00007f1569711000 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f1568b35f80 RCX: 00007f156897d1ff RDX: 000000000000006a RSI: 0000000020000180 RDI: 00000000000000c8 RBP: 00007f15689f175e R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000006a R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f1568b35f80 R15: 00007fff19153ec8 Allocated by task 5736: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 dst_alloc+0x12c/0x190 net/core/dst.c:88 ip6_dst_alloc net/ipv6/route.c:345 [inline] icmp6_dst_alloc+0x7b/0x470 net/ipv6/route.c:3269 ndisc_send_skb+0x344/0x14e0 net/ipv6/ndisc.c:491 addrconf_dad_completed+0x788/0xcb0 net/ipv6/addrconf.c:4280 addrconf_dad_work+0xd8e/0x16b0 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 15: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x292/0x510 mm/slub.c:3683 dst_destroy+0x29e/0x390 net/core/dst.c:123 rcu_do_batch kernel/rcu/tree.c:2297 [inline] rcu_core+0xade/0x1820 kernel/rcu/tree.c:2557 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2845 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0x97b/0x3d50 net/core/dev.c:4256 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0xee6/0x15f0 net/ipv6/ip6_output.c:138 __ip6_finish_output net/ipv6/ip6_output.c:205 [inline] ip6_finish_output+0x6a0/0xa80 net/ipv6/ip6_output.c:216 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] ndisc_send_skb+0xbab/0x14e0 net/ipv6/ndisc.c:511 addrconf_dad_completed+0x788/0xcb0 net/ipv6/addrconf.c:4280 addrconf_dad_work+0xd8e/0x16b0 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2845 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0x97b/0x3d50 net/core/dev.c:4256 dev_queue_xmit include/linux/netdevice.h:3021 [inline] neigh_hh_output include/net/neighbour.h:528 [inline] neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0xeae/0x15f0 net/ipv6/ip6_output.c:138 __ip6_finish_output net/ipv6/ip6_output.c:205 [inline] ip6_finish_output+0x6a0/0xa80 net/ipv6/ip6_output.c:216 dst_output include/net/dst.h:444 [inline] NF_HOOK+0x167/0x530 include/linux/netfilter.h:302 mld_sendpack+0x85e/0xde0 net/ipv6/mcast.c:1820 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x7d7/0xc90 net/ipv6/mcast.c:2653 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff8880632dba00 which belongs to the cache ip6_dst_cache of size 240 The buggy address is located 0 bytes inside of 240-byte region [ffff8880632dba00, ffff8880632dbaf0) The buggy address belongs to the physical page: page:ffffea00018cb6c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x632db memcg:ffff88805e937a81 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001901880 dead000000000009 ffff88802fc06500 raw: 0000000000000000 00000000000c000c 00000001ffffffff ffff88805e937a81 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 22239, tgid 22239 (modprobe), ts 850540184512, free_ts 850521095250 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4313 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5589 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422 dst_alloc+0x12c/0x190 net/core/dst.c:88 ip6_dst_alloc net/ipv6/route.c:345 [inline] icmp6_dst_alloc+0x7b/0x470 net/ipv6/route.c:3269 ndisc_send_skb+0x344/0x14e0 net/ipv6/ndisc.c:491 addrconf_rs_timer+0x357/0x610 net/ipv6/addrconf.c:3963 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 __do_softirq kernel/softirq.c:605 [inline] invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:654 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3464 tlb_batch_list_free mm/mmu_gather.c:75 [inline] tlb_finish_mmu+0x119/0x1f0 mm/mmu_gather.c:364 exit_mmap+0x3c3/0x9f0 mm/mmap.c:3239 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff8880632db900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880632db980: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc >ffff8880632dba00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880632dba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff8880632dbb00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================