================================================================== BUG: KASAN: slab-use-after-free in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88803615cd53 by task syz-executor.2/26059 CPU: 1 PID: 26059 Comm: syz-executor.2 Not tainted 6.5.0-rc6-syzkaller-00036-g4853c74bd7ab #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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+0x11c1/0x2720 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:2785 dst_link_failure include/net/dst.h:437 [inline] ip6_tnl_xmit+0x4f9/0x3960 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:4910 [inline] netdev_start_xmit include/linux/netdevice.h:4924 [inline] xmit_one net/core/dev.c:3537 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3553 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:3827 [inline] __dev_queue_xmit+0x26ab/0x3f20 net/core/dev.c:4169 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0x5d0/0x1b20 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x485/0x11d0 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x243/0x890 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] NF_HOOK include/linux/netfilter.h:297 [inline] ip6_xmit+0xe1d/0x1fe0 net/ipv6/ip6_output.c:344 inet6_csk_xmit+0x3c0/0x730 net/ipv6/inet6_connection_sock.c:135 __tcp_transmit_skb+0x199b/0x3a80 net/ipv4/tcp_output.c:1401 tcp_transmit_skb net/ipv4/tcp_output.c:1419 [inline] tcp_send_syn_data net/ipv4/tcp_output.c:3888 [inline] tcp_connect+0x21ca/0x56c0 net/ipv4/tcp_output.c:3953 tcp_v6_connect+0x1476/0x1fb0 net/ipv6/tcp_ipv6.c:338 __inet_stream_connect+0x947/0xe10 net/ipv4/af_inet.c:666 tcp_sendmsg_fastopen+0x3ce/0x710 net/ipv4/tcp.c:1019 tcp_sendmsg_locked+0x1e5f/0x3420 net/ipv4/tcp.c:1070 tcp_sendmsg+0x2e/0x40 net/ipv4/tcp.c:1333 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:651 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:748 __sys_sendto+0x255/0x340 net/socket.c:2134 __do_sys_sendto net/socket.c:2146 [inline] __se_sys_sendto net/socket.c:2142 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2142 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0901c7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0902a490c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f0901d9bf80 RCX: 00007f0901c7cae9 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f0901cc847a R08: 0000000020b63fe4 R09: 000000000000001c R10: 0000000020008845 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0901d9bf80 R15: 00007fff7dab4da8 Allocated by task 18776: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] kmem_cache_alloc_node+0x179/0x540 mm/slab.c:3509 kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] nlmsg_new include/net/netlink.h:1003 [inline] __neigh_notify+0x83/0x160 net/core/neighbour.c:3502 neigh_cleanup_and_release+0x8f/0x280 net/core/neighbour.c:101 neigh_periodic_work+0x672/0xb60 net/core/neighbour.c:994 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff88803615cc00 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 339 bytes inside of freed 640-byte region [ffff88803615cc00, ffff88803615ce80) The buggy address belongs to the physical page: page:ffffea0000d85700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3615c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x5() raw: 00fff00000000200 ffff888100076e00 ffffea0000c6e210 ffffea0000d8e710 raw: 0000000000000000 ffff88803615c000 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3c2020(__GFP_HIGH|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 21513, tgid 21498 (syz-executor.3), ts 712303659795, free_ts 703389063734 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] kmem_cache_alloc_node+0x487/0x540 mm/slab.c:3509 kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb_fclone include/linux/skbuff.h:1339 [inline] tcp_stream_alloc_skb+0x34/0x560 net/ipv4/tcp.c:867 tso_fragment net/ipv4/tcp_output.c:2123 [inline] tcp_write_xmit+0x113c/0x72b0 net/ipv4/tcp_output.c:2721 __tcp_push_pending_frames+0xaf/0x390 net/ipv4/tcp_output.c:2919 tcp_push_pending_frames include/net/tcp.h:1960 [inline] tcp_data_snd_check net/ipv4/tcp_input.c:5516 [inline] tcp_rcv_established+0x8d0/0x1fa0 net/ipv4/tcp_input.c:6027 tcp_v4_do_rcv+0x669/0x9e0 net/ipv4/tcp_ipv4.c:1728 sk_backlog_rcv include/net/sock.h:1115 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2981 release_sock+0x58/0x1b0 net/core/sock.c:3518 sk_stream_wait_memory+0x6bc/0xff0 net/core/stream.c:145 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 io_destroy_buffers+0x2a8/0x3c0 io_uring/kbuf.c:282 io_ring_ctx_free io_uring/io_uring.c:2875 [inline] io_ring_exit_work+0x9ec/0x1500 io_uring/io_uring.c:3132 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff88803615cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803615cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803615cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803615cd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803615ce00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================