================================================================== BUG: KASAN: use-after-free in rawv6_send_hdrinc net/ipv6/raw.c:692 [inline] BUG: KASAN: use-after-free in rawv6_sendmsg+0x4421/0x4630 net/ipv6/raw.c:921 Read of size 8 at addr ffff8801d80c4db0 by task syz-executor3/26533 CPU: 1 PID: 26533 Comm: syz-executor3 Not tainted 4.19.0-rc4+ #152 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 sg_write: process 530 (syz-executor0) changed security contexts after opening file descriptor, this is not allowed. Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 rawv6_send_hdrinc net/ipv6/raw.c:692 [inline] rawv6_sendmsg+0x4421/0x4630 net/ipv6/raw.c:921 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 __sys_sendmsg+0x11d/0x280 net/socket.c:2154 __compat_sys_sendmsg net/compat.c:754 [inline] __do_compat_sys_sendmsg net/compat.c:761 [inline] __se_compat_sys_sendmsg net/compat.c:758 [inline] __ia32_compat_sys_sendmsg+0x7a/0xb0 net/compat.c:758 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f07ca9 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 0c 24 c3 8b 1c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5ee20cc EFLAGS: 00000296 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020000040 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 26533: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 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_cache_alloc+0x247/0x7b0 net/ipv6/route.c:1184 ip6_pol_route+0x8f8/0xd90 net/ipv6/route.c:1893 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2091 fib6_rule_lookup+0x13a/0x860 net/ipv6/fib6_rules.c:118 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2119 ip6_dst_lookup_tail+0x125c/0x1d60 net/ipv6/ip6_output.c:976 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1077 rawv6_sendmsg+0x12d9/0x4630 net/ipv6/raw.c:905 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 __sys_sendmsg+0x11d/0x280 net/socket.c:2154 __compat_sys_sendmsg net/compat.c:754 [inline] __do_compat_sys_sendmsg net/compat.c:761 [inline] __se_compat_sys_sendmsg net/compat.c:758 [inline] __ia32_compat_sys_sendmsg+0x7a/0xb0 net/compat.c:758 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 20975: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 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+0x83/0x290 mm/slab.c:3756 dst_destroy+0x267/0x3c0 net/core/dst.c:141 dst_destroy_rcu+0x16/0x19 net/core/dst.c:154 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2576 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2880 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2847 [inline] rcu_process_callbacks+0xf23/0x2670 kernel/rcu/tree.c:2864 __do_softirq+0x30b/0xad8 kernel/softirq.c:292 The buggy address belongs to the object at ffff8801d80c4d00 which belongs to the cache ip6_dst_cache of size 240 The buggy address is located 176 bytes inside of 240-byte region [ffff8801d80c4d00, ffff8801d80c4df0) The buggy address belongs to the page: page:ffffea0007603100 count:1 mapcount:0 mapping:ffff8801cb590800 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801cb58f648 ffffea0006f566c8 ffff8801cb590800 raw: 0000000000000000 ffff8801d80c4080 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d80c4c80: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff8801d80c4d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d80c4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ ffff8801d80c4e00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8801d80c4e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== *** Guest State *** CR0: actual=0x000000008005003f, shadow=0x000000008005001f, gh_mask=fffffffffffffff7 CR4: actual=0x0000000000002068, shadow=0x0000000000000028, gh_mask=ffffffffffffe871 CR3 = 0x0000000000000000 RSP = 0x0000000000000000 RIP = 0x000000000000fff0 RFLAGS=0x00000002 DR7 = 0x0000000000000400 Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000