================================================================== 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+0xcc5/0xe00 net/ipv6/route.c:2265 Read of size 4 at addr ffff88802080c578 by task syz-executor.4/10143 CPU: 1 PID: 10143 Comm: syz-executor.4 Not tainted 5.11.0-rc7-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+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 rt6_get_pcpu_route net/ipv6/route.c:1413 [inline] ip6_pol_route+0xcc5/0xe00 net/ipv6/route.c:2265 pol_lookup_func include/net/ip6_fib.h:579 [inline] fib6_rule_lookup+0x3e0/0x630 net/ipv6/fib6_rules.c:120 ip6_route_output_flags+0x60/0x230 net/ipv6/route.c:2525 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0x84c/0x11f0 net/ipv6/ip6_output.c:1064 ip6_dst_lookup_flow+0x7f/0x180 net/ipv6/ip6_output.c:1194 tcp_v6_connect+0xad8/0x1b10 net/ipv6/tcp_ipv6.c:283 __inet_stream_connect+0x6d0/0xd00 net/ipv4/af_inet.c:661 inet_stream_connect+0x4e/0xa0 net/ipv4/af_inet.c:725 mptcp_stream_connect+0x138/0x700 net/mptcp/protocol.c:3192 __sys_connect+0xf5/0x120 net/socket.c:1852 __do_sys_connect net/socket.c:1862 [inline] __se_sys_connect net/socket.c:1859 [inline] __x64_sys_connect+0x6a/0xb0 net/socket.c:1859 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x465d99 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:00007fa0fd815188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465d99 RDX: 000000000000001c RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00000000004bcf27 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffe7155c4ef R14: 00007fa0fd815300 R15: 0000000000022000 Allocated by task 10132: 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:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2892 [inline] slab_alloc mm/slub.c:2900 [inline] kmem_cache_alloc+0x1c6/0x440 mm/slub.c:2905 dst_alloc+0x7c/0x5c0 net/core/dst.c:93 ip6_dst_alloc+0x21/0xf0 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+0x6e5/0xe00 net/ipv6/route.c:2268 pol_lookup_func include/net/ip6_fib.h:579 [inline] fib6_rule_lookup+0x3e0/0x630 net/ipv6/fib6_rules.c:120 ip6_route_output_flags+0x60/0x230 net/ipv6/route.c:2525 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0x84c/0x11f0 net/ipv6/ip6_output.c:1064 ip6_dst_lookup_flow+0x7f/0x180 net/ipv6/ip6_output.c:1194 tcp_v6_connect+0xad8/0x1b10 net/ipv6/tcp_ipv6.c:283 __inet_stream_connect+0x6d0/0xd00 net/ipv4/af_inet.c:661 inet_stream_connect+0x4e/0xa0 net/ipv4/af_inet.c:725 mptcp_stream_connect+0x138/0x700 net/mptcp/protocol.c:3192 __sys_connect+0xf5/0x120 net/socket.c:1852 __do_sys_connect net/socket.c:1862 [inline] __se_sys_connect net/socket.c:1859 [inline] __x64_sys_connect+0x6a/0xb0 net/socket.c:1859 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 18: 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:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kmem_cache_free+0x82/0x350 mm/slub.c:3159 dst_destroy+0x237/0x330 net/core/dst.c:129 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x5eb/0xf00 kernel/rcu/tree.c:2723 __do_softirq+0x29b/0x9f6 kernel/softirq.c:343 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:2965 [inline] call_rcu+0xbb/0x700 kernel/rcu/tree.c:3038 sk_dst_set include/net/sock.h:1999 [inline] sk_dst_reset include/net/sock.h:2011 [inline] ipv6_update_options+0x2b8/0x350 net/ipv6/ipv6_sockglue.c:114 ipv6_set_opt_hdr net/ipv6/ipv6_sockglue.c:383 [inline] do_ipv6_setsockopt.constprop.0+0x76d/0x35b0 net/ipv6/ipv6_sockglue.c:657 ipv6_setsockopt+0xbb/0x120 net/ipv6/ipv6_sockglue.c:1003 tcp_setsockopt+0x10d/0x1ed0 net/ipv4/tcp.c:3644 __sys_setsockopt+0x1fd/0x4e0 net/socket.c:2115 __do_sys_setsockopt net/socket.c:2126 [inline] __se_sys_setsockopt net/socket.c:2123 [inline] __x64_sys_setsockopt+0xb5/0x150 net/socket.c:2123 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802080c500 which belongs to the cache ip6_dst_cache of size 232 The buggy address is located 120 bytes inside of 232-byte region [ffff88802080c500, ffff88802080c5e8) The buggy address belongs to the page: page:000000005288d2da refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2080c flags: 0xfff00000000200(slab) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff88814736ac80 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802080c400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802080c480: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc >ffff88802080c500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802080c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff88802080c600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================