tipc: New replicast peer: fe80:0000:0000:0000:0000:0000:0000:0000 ================================================================== BUG: KASAN: use-after-free in rt6_get_pcpu_route net/ipv6/route.c:1395 [inline] BUG: KASAN: use-after-free in ip6_pol_route+0x1097/0x11d0 net/ipv6/route.c:2244 Read of size 4 at addr ffff888095842078 by task syz-executor.0/7868 CPU: 0 PID: 7868 Comm: syz-executor.0 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 rt6_get_pcpu_route net/ipv6/route.c:1395 [inline] ip6_pol_route+0x1097/0x11d0 net/ipv6/route.c:2244 pol_lookup_func include/net/ip6_fib.h:579 [inline] fib6_rule_lookup+0x52a/0x6f0 net/ipv6/fib6_rules.c:120 ip6_route_output_flags_noref+0x2e2/0x380 net/ipv6/route.c:2618 ip6_route_output_flags+0x72/0x320 net/ipv6/route.c:2631 ip6_dst_lookup_tail+0xa13/0x1620 net/ipv6/ip6_output.c:1120 ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1223 tipc_udp_xmit+0x45e/0xb00 net/tipc/udp_media.c:207 tipc_udp_send_msg+0x27c/0x470 net/tipc/udp_media.c:268 tipc_bearer_xmit_skb+0x1c2/0x400 net/tipc/bearer.c:559 tipc_enable_bearer+0xb12/0xef0 net/tipc/bearer.c:358 __tipc_nl_bearer_enable+0x2f2/0x3e0 net/tipc/bearer.c:1031 tipc_nl_bearer_enable+0x1e/0x30 net/tipc/bearer.c:1040 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:800 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2a1dc5f188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056c0f0 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c0f0 R13: 00007ffd6a4f87df R14: 00007f2a1dc5f300 R15: 0000000000022000 Allocated by task 6843: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x84/0xa0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc+0x285/0x4a0 mm/slub.c:2972 dst_alloc+0x146/0x1f0 net/core/dst.c:93 ip6_dst_alloc+0x2e/0x100 net/ipv6/route.c:340 ip6_rt_pcpu_alloc net/ipv6/route.c:1368 [inline] rt6_make_pcpu_route net/ipv6/route.c:1416 [inline] ip6_pol_route+0x8f3/0x11d0 net/ipv6/route.c:2247 pol_lookup_func include/net/ip6_fib.h:579 [inline] fib6_rule_lookup+0x52a/0x6f0 net/ipv6/fib6_rules.c:120 ip6_route_output_flags_noref+0x2e2/0x380 net/ipv6/route.c:2618 ip6_route_output_flags+0x72/0x320 net/ipv6/route.c:2631 ip6_dst_lookup_tail+0xa13/0x1620 net/ipv6/ip6_output.c:1120 ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1223 tipc_udp_xmit+0x45e/0xb00 net/tipc/udp_media.c:207 tipc_udp_send_msg+0x27c/0x470 net/tipc/udp_media.c:268 tipc_bearer_xmit_skb+0x1c2/0x400 net/tipc/bearer.c:559 tipc_enable_bearer+0xb12/0xef0 net/tipc/bearer.c:358 __tipc_nl_bearer_enable+0x2f2/0x3e0 net/tipc/bearer.c:1031 tipc_nl_bearer_enable+0x1e/0x30 net/tipc/bearer.c:1040 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:800 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 13: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kmem_cache_free+0x8a/0x5b0 mm/slub.c:3229 dst_destroy+0x2d6/0x3f0 net/core/dst.c:129 rcu_do_batch kernel/rcu/tree.c:2550 [inline] rcu_core+0x7ab/0x1380 kernel/rcu/tree.c:2785 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3109 dst_release net/core/dst.c:179 [inline] dst_release+0x79/0xe0 net/core/dst.c:169 dst_cache_per_cpu_get+0x201/0x390 net/core/dst_cache.c:53 dst_cache_get+0x6f/0xb0 net/core/dst_cache.c:68 tipc_udp_xmit+0xc6/0xb00 net/tipc/udp_media.c:175 tipc_udp_send_msg+0x27c/0x470 net/tipc/udp_media.c:268 tipc_bearer_xmit_skb+0x1c2/0x400 net/tipc/bearer.c:559 tipc_disc_timeout+0x75e/0xcb0 net/tipc/discover.c:335 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3109 dst_release net/core/dst.c:179 [inline] dst_release+0x79/0xe0 net/core/dst.c:169 refdst_drop include/net/dst.h:261 [inline] skb_dst_drop include/net/dst.h:273 [inline] skb_scrub_packet+0x30f/0x410 net/core/skbuff.c:5401 geneve_build_skb+0xf3/0x990 drivers/net/geneve.c:750 geneve_xmit_skb drivers/net/geneve.c:967 [inline] geneve_xmit+0xf32/0x3540 drivers/net/geneve.c:1082 __netdev_start_xmit include/linux/netdevice.h:4944 [inline] netdev_start_xmit include/linux/netdevice.h:4958 [inline] xmit_one net/core/dev.c:3659 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3675 __dev_queue_xmit+0x2988/0x3620 net/core/dev.c:4285 neigh_hh_output include/net/neighbour.h:499 [inline] neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0x974/0x19d0 net/ipv6/ip6_output.c:145 __ip6_finish_output net/ipv6/ip6_output.c:210 [inline] __ip6_finish_output+0x4c1/0x1050 net/ipv6/ip6_output.c:189 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:220 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:243 dst_output include/net/dst.h:448 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] mld_sendpack+0x8d4/0xdc0 net/ipv6/mcast.c:1823 mld_send_initial_cr.part.0+0x194/0x230 net/ipv6/mcast.c:2242 mld_send_initial_cr net/ipv6/mcast.c:1227 [inline] ipv6_mc_dad_complete+0x1d0/0x690 net/ipv6/mcast.c:2250 addrconf_dad_completed+0xa20/0xd60 net/ipv6/addrconf.c:4175 addrconf_dad_work+0x79f/0x1340 net/ipv6/addrconf.c:4105 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888095842000 which belongs to the cache ip6_dst_cache of size 232 The buggy address is located 120 bytes inside of 232-byte region [ffff888095842000, ffff8880958420e8) The buggy address belongs to the page: page:ffffea0002561080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x95842 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888147deda00 raw: 0000000000000000 00000000000c000c 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 5290, ts 1907454952427, free_ts 1907327158960 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc+0x3e1/0x4a0 mm/slub.c:2972 dst_alloc+0x146/0x1f0 net/core/dst.c:93 ip6_dst_alloc+0x2e/0x100 net/ipv6/route.c:340 icmp6_dst_alloc+0x6d/0x6c0 net/ipv6/route.c:3278 mld_sendpack+0x586/0xdc0 net/ipv6/mcast.c:1812 mld_send_initial_cr.part.0+0x194/0x230 net/ipv6/mcast.c:2242 mld_send_initial_cr net/ipv6/mcast.c:1227 [inline] ipv6_mc_dad_complete+0x1d0/0x690 net/ipv6/mcast.c:2250 addrconf_dad_completed+0xa20/0xd60 net/ipv6/addrconf.c:4175 addrconf_dad_work+0x79f/0x1340 net/ipv6/addrconf.c:4105 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3411 unfreeze_partials+0x17c/0x1d0 mm/slub.c:2421 put_cpu_partial+0x13d/0x230 mm/slub.c:2457 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc+0x285/0x4a0 mm/slub.c:2972 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags fs/namei.c:2747 [inline] user_path_at_empty+0xa1/0x100 fs/namei.c:2747 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x142/0x390 fs/stat.c:203 vfs_fstatat fs/stat.c:225 [inline] vfs_lstat include/linux/fs.h:3386 [inline] __do_sys_newlstat+0x91/0x110 fs/stat.c:380 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888095841f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888095841f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888095842000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888095842080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888095842100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: ff c3 inc %ebx 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 9: 00 00 00 c: 0f 1f 40 00 nopl 0x0(%rax) 10: 48 89 f8 mov %rdi,%rax 13: 48 89 f7 mov %rsi,%rdi 16: 48 89 d6 mov %rdx,%rsi 19: 48 89 ca mov %rcx,%rdx 1c: 4d 89 c2 mov %r8,%r10 1f: 4d 89 c8 mov %r9,%r8 22: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 27: 0f 05 syscall 29: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 2f: 73 01 jae 0x32 31: c3 retq 32: 48 c7 c1 bc ff ff ff mov $0xffffffffffffffbc,%rcx 39: f7 d8 neg %eax 3b: 64 89 01 mov %eax,%fs:(%rcx) 3e: 48 rex.W