================================================================== BUG: KASAN: use-after-free in ip6_dst_idev include/net/ip6_fib.h:147 [inline] BUG: KASAN: use-after-free in ip6_fragment+0x2d4a/0x2f30 net/ipv6/ip6_output.c:768 Read of size 8 at addr ffff8881c3956318 by task syz-executor.1/6766 CPU: 1 PID: 6766 Comm: syz-executor.1 Not tainted 4.14.139+ #34 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xca/0x134 lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:187 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316 ip6_dst_idev include/net/ip6_fib.h:147 [inline] ip6_fragment+0x2d4a/0x2f30 net/ipv6/ip6_output.c:768 ip6_finish_output+0x66d/0xb40 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip6_output+0x1dc/0x680 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:462 [inline] ip6_local_out+0x98/0x170 net/ipv6/output_core.c:178 ip6_send_skb+0x9b/0x2f0 net/ipv6/ip6_output.c:1688 udp_v6_send_skb+0x4e2/0xe80 net/ipv6/udp.c:1081 udp_v6_push_pending_frames+0x224/0x330 net/ipv6/udp.c:1114 udpv6_sendmsg+0x194b/0x2500 net/ipv6/udp.c:1380 inet_sendmsg+0x15b/0x520 net/ipv4/af_inet.c:760 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb7/0x100 net/socket.c:656 sock_write_iter+0x20f/0x360 net/socket.c:925 call_write_iter include/linux/fs.h:1788 [inline] new_sync_write fs/read_write.c:471 [inline] __vfs_write+0x401/0x5a0 fs/read_write.c:484 vfs_write+0x17f/0x4d0 fs/read_write.c:546 SYSC_write fs/read_write.c:594 [inline] SyS_write+0x102/0x250 fs/read_write.c:586 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459829 RSP: 002b:00007fc204dbfc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 000000000000ffdc RSI: 0000000020000200 RDI: 0000000000000004 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc204dc06d4 R13: 00000000004c995e R14: 00000000004e0fc8 R15: 00000000ffffffff Allocated by task 6286: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:439 [inline] slab_alloc_node mm/slub.c:2758 [inline] slab_alloc mm/slub.c:2766 [inline] kmem_cache_alloc+0xd2/0x2e0 mm/slub.c:2771 dst_alloc+0xe6/0x1a0 net/core/dst.c:107 __ip6_dst_alloc+0x2e/0x50 net/ipv6/route.c:355 ip6_rt_pcpu_alloc net/ipv6/route.c:1034 [inline] rt6_make_pcpu_route net/ipv6/route.c:1064 [inline] ip6_pol_route+0xfed/0x26d0 net/ipv6/route.c:1189 fib6_rule_lookup+0x1e9/0x420 net/ipv6/fib6_rules.c:87 ip6_dst_lookup_tail+0x3ec/0x16f0 net/ipv6/ip6_output.c:997 ip6_dst_lookup_flow+0xac/0x210 net/ipv6/ip6_output.c:1098 inet6_csk_route_socket+0x743/0xbd0 net/ipv6/inet6_connection_sock.c:110 inet6_csk_xmit+0xff/0x500 net/ipv6/inet6_connection_sock.c:125 __tcp_transmit_skb+0x18bc/0x2e20 net/ipv4/tcp_output.c:1130 tcp_transmit_skb net/ipv4/tcp_output.c:1146 [inline] tcp_write_xmit+0x510/0x4680 net/ipv4/tcp_output.c:2381 __tcp_push_pending_frames+0xa0/0x230 net/ipv4/tcp_output.c:2562 tcp_push+0x402/0x600 net/ipv4/tcp.c:715 tcp_sendmsg_locked+0x124f/0x31e0 net/ipv4/tcp.c:1396 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1446 inet_sendmsg+0x15b/0x520 net/ipv4/af_inet.c:760 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb7/0x100 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1de/0x2f0 net/socket.c:1731 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 0xffffffffffffffff Freed by task 7: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x164/0x210 mm/kasan/common.c:457 slab_free_hook mm/slub.c:1403 [inline] slab_free_freelist_hook mm/slub.c:1430 [inline] slab_free mm/slub.c:3005 [inline] kmem_cache_free+0xcb/0x340 mm/slub.c:3021 dst_destroy+0x1cc/0x2d0 net/core/dst.c:138 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2699 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline] rcu_process_callbacks+0x59f/0xf60 kernel/rcu/tree.c:2946 __do_softirq+0x234/0x9ec kernel/softirq.c:288 The buggy address belongs to the object at ffff8881c39561c0 which belongs to the cache ip6_dst_cache of size 384 The buggy address is located 344 bytes inside of 384-byte region [ffff8881c39561c0, ffff8881c3956340) The buggy address belongs to the page: page:ffffea00070e5580 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000000000000 0000000100120012 raw: ffffea00072da000 0000000b0000000b ffff8881d5da5c00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c3956200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c3956280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881c3956300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881c3956380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c3956400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================