================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 Read of size 1 at addr ffff88804ff6643b by task syz-executor.0/30553 CPU: 1 PID: 30553 Comm: syz-executor.0 Not tainted 5.7.0-rc1-next-20200415-syzkaller #0 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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511 kasan_report+0x33/0x50 mm/kasan/common.c:625 decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 xfrm_decode_session_reverse include/net/xfrm.h:1145 [inline] icmpv6_route_lookup+0x2f5/0x470 net/ipv6/icmp.c:388 icmp6_send+0x1263/0x23b0 net/ipv6/icmp.c:588 icmpv6_send+0xde/0x210 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x26/0x520 net/ipv6/route.c:2640 dst_link_failure include/net/dst.h:418 [inline] ip6_tnl_xmit+0x460/0x3470 net/ipv6/ip6_tunnel.c:1248 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1402 [inline] ip6_tnl_start_xmit+0x89a/0x1dc0 net/ipv6/ip6_tunnel.c:1428 __netdev_start_xmit include/linux/netdevice.h:4533 [inline] netdev_start_xmit include/linux/netdevice.h:4547 [inline] xmit_one net/core/dev.c:3477 [inline] dev_hard_start_xmit+0x1a4/0x9b0 net/core/dev.c:3493 sch_direct_xmit+0x345/0xc20 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4d1/0x17b0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3716 [inline] __dev_queue_xmit+0x165b/0x3070 net/core/dev.c:4021 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x1091/0x25b0 net/ipv6/ip6_output.c:117 __ip6_finish_output+0x442/0xab0 net/ipv6/ip6_output.c:143 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x239/0x810 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:435 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:179 ip6_send_skb+0xb4/0x340 net/ipv6/ip6_output.c:1865 udp_v6_send_skb.isra.0+0x7b5/0x15c0 net/ipv6/udp.c:1175 udpv6_sendmsg+0x230a/0x2b40 net/ipv6/udp.c:1473 inet6_sendmsg+0x99/0xe0 net/ipv6/af_inet6.c:577 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x308/0x7e0 net/socket.c:2362 ___sys_sendmsg+0x100/0x170 net/socket.c:2416 __sys_sendmmsg+0x195/0x480 net/socket.c:2506 __do_sys_sendmmsg net/socket.c:2535 [inline] __se_sys_sendmmsg net/socket.c:2532 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2532 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45c829 Code: 0d b7 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 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fa70fbefc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00000000004fc320 RCX: 000000000045c829 RDX: 00000000000000c6 RSI: 0000000020006d00 RDI: 0000000000000004 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008dd R14: 00000000004cb81f R15: 00007fa70fbf06d4 Allocated by task 7497: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468 slab_post_alloc_hook mm/slab.h:586 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x11b/0x740 mm/slab.c:3484 getname_flags fs/namei.c:138 [inline] getname_flags+0xd2/0x5b0 fs/namei.c:128 user_path_at_empty+0x2a/0x50 fs/namei.c:2632 user_path_at include/linux/namei.h:59 [inline] ksys_umount+0x15d/0xe40 fs/namespace.c:1680 __do_sys_umount fs/namespace.c:1706 [inline] __se_sys_umount fs/namespace.c:1704 [inline] __x64_sys_umount+0x50/0x70 fs/namespace.c:1704 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 7497: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x7f/0x320 mm/slab.c:3694 putname+0xe1/0x120 fs/namei.c:259 filename_lookup+0x282/0x3e0 fs/namei.c:2362 user_path_at include/linux/namei.h:59 [inline] ksys_umount+0x15d/0xe40 fs/namespace.c:1680 __do_sys_umount fs/namespace.c:1706 [inline] __se_sys_umount fs/namespace.c:1704 [inline] __x64_sys_umount+0x50/0x70 fs/namespace.c:1704 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff88804ff66380 which belongs to the cache names_cache of size 4096 The buggy address is located 187 bytes inside of 4096-byte region [ffff88804ff66380, ffff88804ff67380) The buggy address belongs to the page: page:ffffea00013fd980 refcount:1 mapcount:0 mapping:000000001255d30d index:0x0 head:ffffea00013fd980 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00015c4508 ffffea00022e5408 ffff8880aa1eb000 raw: 0000000000000000 ffff88804ff66380 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804ff66300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804ff66380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804ff66400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804ff66480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804ff66500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================