================================================================== BUG: KASAN: use-after-free in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88802aaf8a38 by task syz-executor.0/3060 CPU: 1 PID: 3060 Comm: syz-executor.0 Not tainted 6.6.0-rc3-syzkaller-00044-g633b47cb009d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 __xfrm_decode_session+0x54/0xb0 net/xfrm/xfrm_policy.c:3566 xfrm_decode_session_reverse include/net/xfrm.h:1223 [inline] icmpv6_route_lookup+0x397/0x550 net/ipv6/icmp.c:388 icmp6_send+0x11b2/0x2710 net/ipv6/icmp.c:595 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x31/0x5a0 net/ipv6/route.c:2787 dst_link_failure include/net/dst.h:437 [inline] ip6_tnl_xmit+0x4f9/0x3920 net/ipv6/ip6_tunnel.c:1268 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1384 [inline] ip6_tnl_start_xmit+0x6ef/0x1750 net/ipv6/ip6_tunnel.c:1432 __netdev_start_xmit include/linux/netdevice.h:4889 [inline] netdev_start_xmit include/linux/netdevice.h:4903 [inline] xmit_one net/core/dev.c:3544 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3560 sch_direct_xmit+0x1ac/0xc20 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x540/0x19d0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3834 [inline] __dev_queue_xmit+0x24db/0x3d60 net/core/dev.c:4306 dev_queue_xmit include/linux/netdevice.h:3082 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0x581/0x1700 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x485/0x1250 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x1e2/0x530 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] ip6_local_out+0xaf/0x190 net/ipv6/output_core.c:155 ip6_send_skb+0xb7/0x330 net/ipv6/ip6_output.c:2017 ip6_push_pending_frames+0xe0/0x100 net/ipv6/ip6_output.c:2037 rawv6_push_pending_frames net/ipv6/raw.c:581 [inline] rawv6_sendmsg+0x2f95/0x4100 net/ipv6/raw.c:920 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:840 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmsg+0x117/0x1e0 net/socket.c:2624 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7fcc579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7fc75ac EFLAGS: 00000292 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page:ffffea0000aabe00 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x2aaf8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea0000a9e808 ffffea000057ab08 0000000000000000 raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102cc2(GFP_HIGHUSER|__GFP_NOWARN), pid 2865, tgid 2865 (syz-executor.2), ts 2047057242926, free_ts 2047117597685 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0xa6e/0x1540 mm/vmalloc.c:3320 __vmalloc_node mm/vmalloc.c:3385 [inline] vmalloc+0x6b/0x80 mm/vmalloc.c:3418 __snd_dma_alloc_pages+0xcf/0x150 sound/core/memalloc.c:39 snd_dma_alloc_dir_pages+0x151/0x230 sound/core/memalloc.c:73 do_alloc_pages+0x106/0x2e0 sound/core/pcm_memory.c:74 snd_pcm_lib_malloc_pages+0x3d9/0x970 sound/core/pcm_memory.c:459 snd_pcm_hw_params+0x15d1/0x1ae0 sound/core/pcm_native.c:759 snd_pcm_kernel_ioctl+0x13b/0x2c0 sound/core/pcm_native.c:3442 snd_pcm_oss_change_params_locked+0x13f0/0x3ac0 sound/core/oss/pcm_oss.c:976 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1116 [inline] snd_pcm_oss_make_ready+0xe2/0x1a0 sound/core/oss/pcm_oss.c:1175 snd_pcm_oss_sync+0x1d7/0x7f0 sound/core/oss/pcm_oss.c:1742 snd_pcm_oss_release+0x287/0x310 sound/core/oss/pcm_oss.c:2590 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 vfree+0x181/0x7a0 mm/vmalloc.c:2842 snd_dma_free_pages+0xcf/0x130 sound/core/memalloc.c:126 do_free_pages sound/core/pcm_memory.c:93 [inline] do_free_pages sound/core/pcm_memory.c:88 [inline] snd_pcm_lib_free_pages+0x216/0x450 sound/core/pcm_memory.c:499 do_hw_free sound/core/pcm_native.c:876 [inline] snd_pcm_release_substream.part.0+0x29c/0x330 sound/core/pcm_native.c:2709 snd_pcm_release_substream+0x5b/0x70 sound/core/pcm_native.c:2703 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2413 [inline] snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2405 [inline] snd_pcm_oss_release+0x175/0x310 sound/core/oss/pcm_oss.c:2592 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __ia32_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Memory state around the buggy address: ffff88802aaf8900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802aaf8980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802aaf8a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802aaf8a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802aaf8b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi