================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3393 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x1b92/0x2710 net/xfrm/xfrm_policy.c:3485 Read of size 1 at addr ffff88802059fc12 by task syz-executor.2/9816 CPU: 1 PID: 9816 Comm: syz-executor.2 Not tainted 5.9.0-rc3-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+0x1d6/0x29e lib/dump_stack.c:118 print_address_description+0x66/0x620 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 decode_session6 net/xfrm/xfrm_policy.c:3393 [inline] __xfrm_decode_session+0x1b92/0x2710 net/xfrm/xfrm_policy.c:3485 vti_tunnel_xmit+0x1e7/0x1520 net/ipv4/ip_vti.c:293 __netdev_start_xmit include/linux/netdevice.h:4634 [inline] netdev_start_xmit include/linux/netdevice.h:4648 [inline] xmit_one net/core/dev.c:3561 [inline] dev_hard_start_xmit+0x1bd/0x3d0 net/core/dev.c:3577 sch_direct_xmit+0x1f0/0xd40 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x9ed/0x19f0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3800 [inline] __dev_queue_xmit+0x141b/0x2940 net/core/dev.c:4105 packet_snd net/packet/af_packet.c:2984 [inline] packet_sendmsg+0x4b60/0x6510 net/packet/af_packet.c:3009 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg net/socket.c:671 [inline] ____sys_sendmsg+0x519/0x800 net/socket.c:2353 ___sys_sendmsg net/socket.c:2407 [inline] __sys_sendmsg+0x2b1/0x360 net/socket.c:2440 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d5b9 Code: 5d 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f84f7b4fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000027bc0 RCX: 000000000045d5b9 RDX: 0000000000000080 RSI: 0000000020000440 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffcf13fb73f R14: 00007f84f7b509c0 R15: 000000000118cf4c Allocated by task 6833: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461 slab_post_alloc_hook+0x3e/0x290 mm/slab.h:518 slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x1c1/0x2d0 mm/slab.c:3482 dup_mm+0x26/0x320 kernel/fork.c:1345 copy_mm kernel/fork.c:1410 [inline] copy_process+0x1fdc/0x5200 kernel/fork.c:2069 _do_fork+0x1ab/0x6d0 kernel/fork.c:2428 __do_sys_clone kernel/fork.c:2545 [inline] __se_sys_clone kernel/fork.c:2529 [inline] __x64_sys_clone+0x1e9/0x230 kernel/fork.c:2529 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 9604: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:56 kasan_set_free_info+0x17/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xdd/0x110 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kmem_cache_free+0x82/0xf0 mm/slab.c:3693 exit_mm+0x4cd/0x550 kernel/exit.c:483 do_exit+0x576/0x1f20 kernel/exit.c:793 do_group_exit+0x161/0x2d0 kernel/exit.c:903 __do_sys_exit_group+0x13/0x20 kernel/exit.c:914 __ia32_sys_exit_group+0x0/0x40 kernel/exit.c:912 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:912 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802059f700 which belongs to the cache mm_struct of size 1584 The buggy address is located 1298 bytes inside of 1584-byte region [ffff88802059f700, ffff88802059fd30) The buggy address belongs to the page: page:0000000012185b13 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2059e head:0000000012185b13 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0002564108 ffffea0001228688 ffff88821bc47700 raw: 0000000000000000 ffff88802059e2c0 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802059fb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802059fb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802059fc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802059fc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802059fd00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ==================================================================