================================================================== BUG: KASAN: use-after-free in __atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline] BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic.h:533 [inline] BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:308 [inline] BUG: KASAN: use-after-free in ip6_hold_safe+0xbe/0x440 net/ipv6/route.c:1029 Write of size 4 at addr ffff8801cfea0600 by task syz-executor2/17859 CPU: 0 PID: 17859 Comm: syz-executor2 Not tainted 4.18.0-rc7+ #169 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+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 __atomic_add_unless include/asm-generic/atomic-instrumented.h:89 [inline] atomic_add_unless include/linux/atomic.h:533 [inline] dst_hold_safe include/net/dst.h:308 [inline] ip6_hold_safe+0xbe/0x440 net/ipv6/route.c:1029 rt6_get_pcpu_route net/ipv6/route.c:1249 [inline] ip6_pol_route+0x3ad/0x1250 net/ipv6/route.c:1922 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2098 fib6_rule_lookup+0x26e/0x700 net/ipv6/fib6_rules.c:122 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2126 ip6_dst_lookup_tail+0x1278/0x1da0 net/ipv6/ip6_output.c:978 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1079 inet6_csk_route_socket+0x8cb/0x1030 net/ipv6/inet6_connection_sock.c:110 inet6_csk_xmit+0x118/0x630 net/ipv6/inet6_connection_sock.c:125 l2tp_xmit_core net/l2tp/l2tp_core.c:1040 [inline] l2tp_xmit_skb+0x1406/0x17c0 net/l2tp/l2tp_core.c:1144 pppol2tp_sendmsg+0x4ae/0x6c0 net/l2tp/l2tp_ppp.c:341 sock_sendmsg_nosec net/socket.c:641 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:651 ___sys_sendmsg+0x51d/0x930 net/socket.c:2125 __sys_sendmmsg+0x240/0x6f0 net/socket.c:2220 __do_sys_sendmmsg net/socket.c:2249 [inline] __se_sys_sendmmsg net/socket.c:2246 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2246 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x456a09 Code: fd b4 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 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fbf839b3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fbf839b46d4 RCX: 0000000000456a09 RDX: 00000000000003e8 RSI: 0000000020005fc0 RDI: 0000000000000014 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004d2c98 R14: 00000000004c7a00 R15: 0000000000000000 Allocated by task 17798: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554 dst_alloc+0xbb/0x1d0 net/core/dst.c:105 ip6_dst_alloc+0x35/0xa0 net/ipv6/route.c:353 ip6_rt_pcpu_alloc net/ipv6/route.c:1229 [inline] rt6_make_pcpu_route net/ipv6/route.c:1259 [inline] ip6_pol_route+0x83f/0x1250 net/ipv6/route.c:1925 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2098 fib6_rule_lookup+0x26e/0x700 net/ipv6/fib6_rules.c:122 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2126 ip6_dst_lookup_tail+0x1278/0x1da0 net/ipv6/ip6_output.c:978 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1079 ip6_sk_dst_lookup_flow+0x5d2/0xac0 net/ipv6/ip6_output.c:1117 udpv6_sendmsg+0x20f9/0x35f0 net/ipv6/udp.c:1357 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:641 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:651 ___sys_sendmsg+0x51d/0x930 net/socket.c:2125 __sys_sendmmsg+0x240/0x6f0 net/socket.c:2220 __do_sys_sendmmsg net/socket.c:2249 [inline] __se_sys_sendmmsg net/socket.c:2246 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2246 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 17855: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x86/0x2d0 mm/slab.c:3756 dst_destroy+0x267/0x3c0 net/core/dst.c:141 dst_destroy_rcu+0x16/0x20 net/core/dst.c:154 __rcu_reclaim kernel/rcu/rcu.h:178 [inline] rcu_do_batch kernel/rcu/tree.c:2558 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2818 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2785 [inline] rcu_process_callbacks+0xed5/0x1850 kernel/rcu/tree.c:2802 __do_softirq+0x2e8/0xb17 kernel/softirq.c:292 The buggy address belongs to the object at ffff8801cfea05c0 which belongs to the cache ip6_dst_cache of size 240 The buggy address is located 64 bytes inside of 240-byte region [ffff8801cfea05c0, ffff8801cfea06b0) The buggy address belongs to the page: page:ffffea00073fa800 count:1 mapcount:0 mapping:ffff8801cde0cac0 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0006fecc88 ffffea000721a788 ffff8801cde0cac0 raw: 0000000000000000 ffff8801cfea00c0 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cfea0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff8801cfea0580: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801cfea0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cfea0680: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff8801cfea0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================