================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3393 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3485 Read of size 1 at addr ffff88809166e75e by task syz-executor.3/13510 CPU: 1 PID: 13510 Comm: syz-executor.3 Not tainted 5.5.0-rc2-next-20191220-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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:132 decode_session6 net/xfrm/xfrm_policy.c:3393 [inline] __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3485 xfrm_decode_session include/net/xfrm.h:1138 [inline] vti_tunnel_xmit+0x277/0x17e0 net/ipv4/ip_vti.c:269 __netdev_start_xmit include/linux/netdevice.h:4450 [inline] netdev_start_xmit include/linux/netdevice.h:4464 [inline] xmit_one net/core/dev.c:3420 [inline] dev_hard_start_xmit+0x1a3/0x9b0 net/core/dev.c:3436 sch_direct_xmit+0x372/0xd30 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4bf/0x1770 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3677 [inline] __dev_queue_xmit+0x1650/0x35c0 net/core/dev.c:3982 dev_queue_xmit+0x18/0x20 net/core/dev.c:4046 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1527 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x109a/0x25c0 net/ipv6/ip6_output.c:116 __ip6_finish_output+0x444/0xaa0 net/ipv6/ip6_output.c:142 ip6_finish_output+0x38/0x1f0 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x25e/0x880 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] ip6_local_out+0xbb/0x1b0 net/ipv6/output_core.c:179 ip6_send_skb+0xbb/0x350 net/ipv6/ip6_output.c:1795 udp_v6_send_skb.isra.0+0x7b0/0x15b0 net/ipv6/udp.c:1173 udpv6_sendmsg+0x22f3/0x2b30 net/ipv6/udp.c:1471 inet6_sendmsg+0x9e/0xe0 net/ipv6/af_inet6.c:576 sock_sendmsg_nosec net/socket.c:643 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:663 ____sys_sendmsg+0x358/0x880 net/socket.c:2342 ___sys_sendmsg+0x100/0x170 net/socket.c:2396 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2486 __do_sys_sendmmsg net/socket.c:2515 [inline] __se_sys_sendmmsg net/socket.c:2512 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2512 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a919 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f160d5e3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045a919 RDX: 0000000000000066 RSI: 000000002000ac80 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000003e8 R11: 0000000000000246 R12: 00007f160d5e46d4 R13: 00000000004c9267 R14: 00000000004e0fa0 R15: 00000000ffffffff Allocated by task 9331: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 __do_kmalloc_node mm/slab.c:3616 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3630 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:141 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:209 alloc_skb include/linux/skbuff.h:1049 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:321 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:373 [inline] nsim_dev_trap_report_work+0x25c/0xaf0 drivers/net/netdevsim/dev.c:412 process_one_work+0x9af/0x1740 kernel/workqueue.c:2264 worker_thread+0x98/0xe40 kernel/workqueue.c:2410 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 9331: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 skb_free_head+0x93/0xb0 net/core/skbuff.c:591 skb_release_data+0x613/0x8c0 net/core/skbuff.c:611 skb_release_all+0x4d/0x60 net/core/skbuff.c:665 __kfree_skb net/core/skbuff.c:679 [inline] consume_skb net/core/skbuff.c:838 [inline] consume_skb+0xfb/0x410 net/core/skbuff.c:832 nsim_dev_trap_report drivers/net/netdevsim/dev.c:387 [inline] nsim_dev_trap_report_work+0x7cb/0xaf0 drivers/net/netdevsim/dev.c:412 process_one_work+0x9af/0x1740 kernel/workqueue.c:2264 worker_thread+0x98/0xe40 kernel/workqueue.c:2410 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88809166e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1886 bytes inside of 4096-byte region [ffff88809166e000, ffff88809166f000) The buggy address belongs to the page: page:ffffea0002459b80 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 raw: 00fffe0000010200 ffffea0002322108 ffffea000138ac88 ffff8880aa402000 raw: 0000000000000000 ffff88809166e000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809166e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809166e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809166e700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809166e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809166e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================