================================================================== BUG: KASAN: use-after-free in rt6_get_pcpu_route net/ipv6/route.c:1413 [inline] BUG: KASAN: use-after-free in ip6_pol_route+0x1087/0x11c0 net/ipv6/route.c:2265 Read of size 4 at addr ffff88801944d938 by task syz-executor.2/23246 CPU: 0 PID: 23246 Comm: syz-executor.2 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:397 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:414 rt6_get_pcpu_route net/ipv6/route.c:1413 [inline] ip6_pol_route+0x1087/0x11c0 net/ipv6/route.c:2265 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:2512 ip6_route_output_flags+0x8b/0x310 net/ipv6/route.c:2525 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0xb6e/0x1740 net/ipv6/ip6_output.c:1064 ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1194 tcp_v6_connect+0xdb3/0x1df0 net/ipv6/tcp_ipv6.c:283 __inet_stream_connect+0x8cf/0xed0 net/ipv4/af_inet.c:664 inet_stream_connect+0x53/0xa0 net/ipv4/af_inet.c:728 __sys_connect_file+0x155/0x1a0 net/socket.c:1837 __sys_connect+0x161/0x190 net/socket.c:1854 __do_sys_connect net/socket.c:1864 [inline] __se_sys_connect net/socket.c:1861 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:1861 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x465ef9 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:00007f4974d18188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465ef9 RDX: 000000000000001c RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00000000004bcd1c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffcf14b54ff R14: 00007f4974d18300 R15: 0000000000022000 Allocated by task 12285: 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:400 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:428 kasan_slab_alloc include/linux/kasan.h:208 [inline] slab_post_alloc_hook mm/slab.h:516 [inline] slab_alloc_node mm/slub.c:2895 [inline] slab_alloc mm/slub.c:2903 [inline] kmem_cache_alloc+0x1c6/0x440 mm/slub.c:2908 dst_alloc+0x9e/0x650 net/core/dst.c:93 ip6_dst_alloc+0x2e/0x100 net/ipv6/route.c:358 ip6_rt_pcpu_alloc net/ipv6/route.c:1386 [inline] rt6_make_pcpu_route net/ipv6/route.c:1434 [inline] ip6_pol_route+0x910/0x11c0 net/ipv6/route.c:2268 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:2512 ip6_route_output_flags+0x8b/0x310 net/ipv6/route.c:2525 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0xb6e/0x1740 net/ipv6/ip6_output.c:1064 ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1194 tcp_v6_connect+0xdb3/0x1df0 net/ipv6/tcp_ipv6.c:283 __inet_stream_connect+0x8cf/0xed0 net/ipv4/af_inet.c:664 inet_stream_connect+0x53/0xa0 net/ipv4/af_inet.c:728 __sys_connect_file+0x155/0x1a0 net/socket.c:1837 __sys_connect+0x161/0x190 net/socket.c:1854 __do_sys_connect net/socket.c:1864 [inline] __se_sys_connect net/socket.c:1861 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:1861 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 178: 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:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:361 kasan_slab_free include/linux/kasan.h:191 [inline] slab_free_hook mm/slub.c:1561 [inline] slab_free_freelist_hook+0x51/0x130 mm/slub.c:1594 slab_free mm/slub.c:3146 [inline] kmem_cache_free+0x82/0x350 mm/slub.c:3162 dst_destroy+0x2bc/0x3c0 net/core/dst.c:129 rcu_do_batch kernel/rcu/tree.c:2559 [inline] rcu_core+0x722/0x1280 kernel/rcu/tree.c:2794 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xc5/0xf0 mm/kasan/generic.c:344 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0xb1/0x700 kernel/rcu/tree.c:3114 dst_release net/core/dst.c:179 [inline] dst_release+0x79/0xe0 net/core/dst.c:169 sk_dst_set include/net/sock.h:2001 [inline] sk_dst_reset include/net/sock.h:2013 [inline] ipv6_update_options+0x18c/0x3e0 net/ipv6/ipv6_sockglue.c:114 ipv6_set_opt_hdr net/ipv6/ipv6_sockglue.c:383 [inline] do_ipv6_setsockopt.constprop.0+0x940/0x41f0 net/ipv6/ipv6_sockglue.c:657 ipv6_setsockopt+0xd6/0x180 net/ipv6/ipv6_sockglue.c:1003 tcp_setsockopt+0x136/0x2440 net/ipv4/tcp.c:3636 mptcp_setsockopt+0x612/0x780 net/mptcp/protocol.c:2871 __sys_setsockopt+0x2db/0x610 net/socket.c:2117 __do_sys_setsockopt net/socket.c:2128 [inline] __se_sys_setsockopt net/socket.c:2125 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2125 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xc5/0xf0 mm/kasan/generic.c:344 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0xb1/0x700 kernel/rcu/tree.c:3114 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_release_head_state+0x1f9/0x250 net/core/skbuff.c:709 skb_release_all net/core/skbuff.c:723 [inline] __kfree_skb net/core/skbuff.c:739 [inline] kfree_skb net/core/skbuff.c:757 [inline] kfree_skb+0xfa/0x3f0 net/core/skbuff.c:751 br_flood+0x39d/0x450 net/bridge/br_forward.c:238 br_dev_xmit+0xdf0/0x1690 net/bridge/br_device.c:95 __netdev_start_xmit include/linux/netdevice.h:4825 [inline] netdev_start_xmit include/linux/netdevice.h:4839 [inline] xmit_one net/core/dev.c:3593 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3609 __dev_queue_xmit+0x2121/0x2e00 net/core/dev.c:4182 neigh_hh_output include/net/neighbour.h:499 [inline] neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0x8d5/0x16b0 net/ipv6/ip6_output.c:117 __ip6_finish_output net/ipv6/ip6_output.c:182 [inline] __ip6_finish_output+0x4c1/0xe10 net/ipv6/ip6_output.c:161 ip6_finish_output+0x35/0x200 net/ipv6/ip6_output.c:192 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:215 dst_output include/net/dst.h:448 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] mld_sendpack+0x92a/0xdb0 net/ipv6/mcast.c:1679 mld_send_cr net/ipv6/mcast.c:1975 [inline] mld_ifc_timer_expire+0x60a/0xf10 net/ipv6/mcast.c:2474 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431 expire_timers kernel/time/timer.c:1476 [inline] __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1745 __run_timers kernel/time/timer.c:1726 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 The buggy address belongs to the object at ffff88801944d8c0 which belongs to the cache ip6_dst_cache of size 232 The buggy address is located 120 bytes inside of 232-byte region [ffff88801944d8c0, ffff88801944d9a8) The buggy address belongs to the page: page:00000000b9ab5ba3 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801944d280 pfn:0x1944d flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000989c88 ffffea0000a12248 ffff888146e08500 raw: ffff88801944d280 00000000000c000a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801944d800: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88801944d880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff88801944d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801944d980: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff88801944da00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================