================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3460 [inline] BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x1a49/0x2450 net/xfrm/xfrm_policy.c:3566 Read of size 1 at addr ffff88807c21b08f by task syz-executor.4/28722 CPU: 1 PID: 28722 Comm: syz-executor.4 Not tainted 6.5.0-rc5-syzkaller-00021-ga027b2eca0b7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 decode_session6 net/xfrm/xfrm_policy.c:3460 [inline] __xfrm_decode_session+0x1a49/0x2450 net/xfrm/xfrm_policy.c:3566 xfrm_decode_session_reverse include/net/xfrm.h:1223 [inline] icmpv6_route_lookup+0x4b3/0x730 net/ipv6/icmp.c:388 icmp6_send+0x125c/0x20e0 net/ipv6/icmp.c:595 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x3b/0x4a0 net/ipv6/route.c:2785 dst_link_failure include/net/dst.h:437 [inline] ip6_tnl_xmit+0xda6/0x2860 net/ipv6/ip6_tunnel.c:1268 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1384 [inline] ip6_tnl_start_xmit+0xb8a/0x13f0 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+0x241/0x750 net/core/dev.c:3553 sch_direct_xmit+0x2b6/0x5f0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0xa8c/0x1f80 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3827 [inline] __dev_queue_xmit+0x1397/0x38b0 net/core/dev.c:4169 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0xf80/0x1560 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x6b0/0xa80 net/ipv6/ip6_output.c:207 dst_output include/net/dst.h:458 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] ip6_xmit+0x1094/0x1910 net/ipv6/ip6_output.c:344 inet6_csk_xmit+0x448/0x6b0 net/ipv6/inet6_connection_sock.c:135 __tcp_transmit_skb+0x1e8d/0x3440 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+0x2e13/0x4ed0 net/ipv4/tcp_output.c:3953 tcp_v6_connect+0x141a/0x1d70 net/ipv6/tcp_ipv6.c:338 __inet_stream_connect+0x258/0xe60 net/ipv4/af_inet.c:666 tcp_sendmsg_fastopen+0x3a1/0x600 net/ipv4/tcp.c:1019 tcp_sendmsg_locked+0x4929/0x5010 net/ipv4/tcp.c:1070 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1333 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] __sys_sendto+0x484/0x640 net/socket.c:2134 __do_sys_sendto net/socket.c:2146 [inline] __se_sys_sendto net/socket.c:2142 [inline] __x64_sys_sendto+0xde/0xf0 net/socket.c:2142 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f8affc7cae9 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:00007f8b0098a0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f8affd9bf80 RCX: 00007f8affc7cae9 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f8affcc847a R08: 0000000020b63fe4 R09: 000000000000001b R10: 0000000020008845 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8affd9bf80 R15: 00007ffc1fdc7f08 Allocated by task 18368: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc_node+0xb8/0x230 mm/slab_common.c:992 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0x72/0x180 mm/util.c:604 kvmalloc include/linux/slab.h:720 [inline] kvzalloc include/linux/slab.h:728 [inline] alloc_netdev_mqs+0x8d/0xf40 net/core/dev.c:10594 rtnl_create_link+0x2ea/0xc10 net/core/rtnetlink.c:3336 veth_newlink+0x2cc/0xce0 drivers/net/veth.c:1892 rtnl_newlink_create net/core/rtnetlink.c:3472 [inline] __rtnl_newlink net/core/rtnetlink.c:3689 [inline] rtnl_newlink+0x1500/0x2000 net/core/rtnetlink.c:3702 rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6428 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg net/socket.c:748 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2494 ___sys_sendmsg net/socket.c:2548 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2577 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88807c21a000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 968 bytes to the right of allocated 3271-byte region [ffff88807c21a000, ffff88807c21acc7) The buggy address belongs to the physical page: page:ffffea0001f08600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c218 head:ffffea0001f08600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807c511fc1 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff88801284f500 ffffea0001fd4600 0000000000000002 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88807c511fc1 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 17800, tgid 17800 (udevd), ts 998089314324, free_ts 998051814703 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 alloc_slab_page+0x6a/0x160 mm/slub.c:1862 allocate_slab mm/slub.c:2009 [inline] new_slab+0x84/0x2f0 mm/slub.c:2062 ___slab_alloc+0xade/0x1100 mm/slub.c:3215 __slab_alloc mm/slub.c:3314 [inline] __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node+0xa7/0x230 mm/slab_common.c:992 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0x72/0x180 mm/util.c:604 kvmalloc include/linux/slab.h:720 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x202/0xd10 fs/seq_file.c:210 call_read_iter include/linux/fs.h:1871 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x795/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443 discard_slab mm/slub.c:2108 [inline] __unfreeze_partials+0x1dc/0x220 mm/slub.c:2647 put_cpu_partial+0x116/0x180 mm/slub.c:2723 __slab_free+0x2b6/0x390 mm/slub.c:3671 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x6c/0x3b0 mm/slab.h:762 slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x141/0x270 mm/slub.c:3509 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] kernfs_iop_get_link+0x67/0x5a0 fs/kernfs/symlink.c:135 vfs_readlink+0x16e/0x400 fs/namei.c:5105 do_readlinkat+0x283/0x3b0 fs/stat.c:489 __do_sys_readlink fs/stat.c:510 [inline] __se_sys_readlink fs/stat.c:507 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:507 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88807c21af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c21b000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807c21b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807c21b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c21b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================