================================================================== BUG: KASAN: use-after-free in rt_cache_valid+0x158/0x190 net/ipv4/route.c:1517 Read of size 2 at addr ffff88809fa67953 by task syz-executor.0/9583 CPU: 1 PID: 9583 Comm: syz-executor.0 Not tainted 5.0.0+ #122 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load2_noabort+0x14/0x20 mm/kasan/generic_report.c:130 rt_cache_valid+0x158/0x190 net/ipv4/route.c:1517 __mkroute_output net/ipv4/route.c:2273 [inline] ip_route_output_key_hash_rcu+0x89d/0x30e0 net/ipv4/route.c:2505 ip_route_output_key_hash+0x212/0x380 net/ipv4/route.c:2334 __ip_route_output_key include/net/route.h:124 [inline] ip_route_connect include/net/route.h:302 [inline] __ip4_datagram_connect+0x6fb/0x1330 net/ipv4/datagram.c:51 __ip6_datagram_connect+0xe98/0x1390 net/ipv6/datagram.c:191 ip6_datagram_connect+0x30/0x50 net/ipv6/datagram.c:273 inet_dgram_connect+0x150/0x2e0 net/ipv4/af_inet.c:571 __sys_connect+0x266/0x330 net/socket.c:1685 __do_sys_connect net/socket.c:1696 [inline] __se_sys_connect net/socket.c:1693 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:1693 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458079 Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdfa9d76c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458079 RDX: 000000000000001c RSI: 00000000200004c0 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdfa9d776d4 R13: 00000000004be3fb R14: 00000000004ceb88 R15: 00000000ffffffff Allocated by task 1063: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 slab_post_alloc_hook mm/slab.h:436 [inline] slab_alloc mm/slab.c:3392 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3554 dst_alloc+0x10e/0x200 net/core/dst.c:109 rt_dst_alloc+0x83/0x3f0 net/ipv4/route.c:1573 __mkroute_output net/ipv4/route.c:2278 [inline] ip_route_output_key_hash_rcu+0x97d/0x30e0 net/ipv4/route.c:2505 ip_route_output_key_hash+0x212/0x380 net/ipv4/route.c:2334 __ip_route_output_key include/net/route.h:124 [inline] ip_route_output_flow+0x28/0xc0 net/ipv4/route.c:2589 udp_sendmsg+0x1aec/0x2820 net/ipv4/udp.c:1154 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:632 ___sys_sendmsg+0x3e2/0x930 net/socket.c:2137 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2232 __do_sys_sendmmsg net/socket.c:2261 [inline] __se_sys_sendmmsg net/socket.c:2258 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2258 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3764 dst_destroy+0x2a0/0x3c0 net/core/dst.c:145 dst_destroy_rcu+0x16/0x19 net/core/dst.c:158 __rcu_reclaim kernel/rcu/rcu.h:227 [inline] rcu_do_batch kernel/rcu/tree.c:2475 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2788 [inline] rcu_core+0x928/0x1390 kernel/rcu/tree.c:2769 __do_softirq+0x266/0x95a kernel/softirq.c:293 The buggy address belongs to the object at ffff88809fa67900 which belongs to the cache ip_dst_cache of size 160 The buggy address is located 83 bytes inside of 160-byte region [ffff88809fa67900, ffff88809fa679a0) The buggy address belongs to the page: page:ffffea00027e99c0 count:1 mapcount:0 mapping:ffff8880a807a540 index:0xffff88809fa67a00 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00018fd5c8 ffffea000267a508 ffff8880a807a540 raw: ffff88809fa67a00 ffff88809fa67000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809fa67800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809fa67880: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809fa67900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809fa67980: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff88809fa67a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================