================================================================== BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 Read of size 1 at addr ffff888023656eda by task syz-executor.5/16203 CPU: 1 PID: 16203 Comm: syz-executor.5 Not tainted 5.10.0-rc6-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+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3485 xfrm_decode_session include/net/xfrm.h:1137 [inline] vti6_tnl_xmit+0x40d/0x1cd0 net/ipv6/ip6_vti.c:575 __netdev_start_xmit include/linux/netdevice.h:4723 [inline] netdev_start_xmit include/linux/netdevice.h:4737 [inline] xmit_one net/core/dev.c:3564 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3580 sch_direct_xmit+0x2e1/0xbd0 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4ba/0x15e0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3803 [inline] __dev_queue_xmit+0x19fa/0x2da0 net/core/dev.c:4108 neigh_connected_output+0x380/0x4c0 net/core/neighbour.c:1520 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x6b8/0x16c0 net/ipv6/ip6_output.c:117 __ip6_finish_output net/ipv6/ip6_output.c:143 [inline] __ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] mld_sendpack+0x92a/0xdb0 net/ipv6/mcast.c:1679 mld_send_cr net/ipv6/mcast.c:1975 [inline] mld_ifc_timer_expire+0x60a/0xf10 net/ipv6/mcast.c:2474 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1410 expire_timers kernel/time/timer.c:1455 [inline] __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1747 __run_timers kernel/time/timer.c:1728 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1760 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x132/0x200 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631 RIP: 0010:check_kcov_mode kernel/kcov.c:163 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x19/0x60 kernel/kcov.c:197 Code: 8b 54 24 08 48 8b 34 24 e9 a1 fd ff ff 0f 1f 40 00 65 48 8b 14 25 00 f0 01 00 65 8b 05 30 eb 91 7e a9 00 01 ff 00 48 8b 34 24 <74> 0f f6 c4 01 74 35 8b 82 5c 14 00 00 85 c0 74 2b 8b 82 38 14 00 RSP: 0018:ffffc900098ef778 EFLAGS: 00000246 RAX: 0000000080000002 RBX: dffffc0000000000 RCX: ffffffff81a27d77 RDX: ffff88806c97cec0 RSI: ffffffff81a1326e RDI: ffff8880225fed68 RBP: 1ffff9200131def1 R08: 0000000000000000 R09: ffffea00009fd307 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880225fed68 R13: 00007f0f2a54d000 R14: 0000000000000001 R15: 00007f0f2a5b8000 vm_normal_page+0x6e/0x2a0 mm/memory.c:597 copy_present_pte mm/memory.c:860 [inline] copy_pte_range mm/memory.c:978 [inline] copy_pmd_range mm/memory.c:1058 [inline] copy_pud_range mm/memory.c:1095 [inline] copy_p4d_range mm/memory.c:1119 [inline] copy_page_range+0xdc6/0x3dc0 mm/memory.c:1183 dup_mmap kernel/fork.c:593 [inline] dup_mm+0x989/0x12a0 kernel/fork.c:1357 copy_mm kernel/fork.c:1413 [inline] copy_process+0x2a07/0x6e80 kernel/fork.c:2095 kernel_clone+0xe7/0xab0 kernel/fork.c:2456 __do_sys_clone+0xc8/0x110 kernel/fork.c:2573 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45c48a Code: f7 d8 64 89 04 25 d4 02 00 00 64 4c 8b 0c 25 10 00 00 00 31 d2 4d 8d 91 d0 02 00 00 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 f5 00 00 00 85 c0 41 89 c5 0f 85 fc 00 00 RSP: 002b:00007ffd03efcce0 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007ffd03efcce0 RCX: 000000000045c48a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 00007ffd03efcd20 R08: 0000000000000001 R09: 000000000291d940 R10: 000000000291dc10 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffd03efcd70 Allocated by task 529: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:526 [inline] slab_alloc_node mm/slub.c:2891 [inline] slab_alloc mm/slub.c:2899 [inline] kmem_cache_alloc+0x122/0x460 mm/slub.c:2904 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags+0x9a/0xe0 include/linux/audit.h:320 getname fs/namei.c:209 [inline] do_symlinkat+0x86/0x2c0 fs/namei.c:3976 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 529: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x102/0x140 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1544 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577 slab_free mm/slub.c:3142 [inline] kmem_cache_free+0x82/0x350 mm/slub.c:3158 putname+0xe1/0x120 fs/namei.c:259 do_symlinkat+0x1b2/0x2c0 fs/namei.c:3994 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888023656600 which belongs to the cache names_cache of size 4096 The buggy address is located 2266 bytes inside of 4096-byte region [ffff888023656600, ffff888023657600) The buggy address belongs to the page: page:00000000f2d7fd28 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23650 head:00000000f2d7fd28 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8880101c5280 raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888023656d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888023656e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888023656e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888023656f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888023656f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================