================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3465 Read of size 1 at addr ffff888079db0709 by task syz-executor.3/4339 CPU: 1 PID: 4339 Comm: syz-executor.3 Not tainted 6.6.0-rc7-syzkaller-00089-gc17cda15cc86 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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:3465 __xfrm_decode_session+0x54/0xb0 net/xfrm/xfrm_policy.c:3571 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:3573 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3589 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:3863 [inline] __dev_queue_xmit+0x24db/0x3d60 net/core/dev.c:4335 dev_queue_xmit include/linux/netdevice.h:3082 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1585 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0x584/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] NF_HOOK include/linux/netfilter.h:304 [inline] NF_HOOK include/linux/netfilter.h:298 [inline] ip6_xmit+0x1253/0x1cf0 net/ipv6/ip6_output.c:344 inet6_csk_xmit+0x3be/0x730 net/ipv6/inet6_connection_sock.c:135 __tcp_transmit_skb+0x1a15/0x3af0 net/ipv4/tcp_output.c:1415 tcp_transmit_skb net/ipv4/tcp_output.c:1433 [inline] tcp_send_syn_data net/ipv4/tcp_output.c:3911 [inline] tcp_connect+0x210a/0x5430 net/ipv4/tcp_output.c:3976 tcp_v6_connect+0x147f/0x2000 net/ipv6/tcp_ipv6.c:338 __inet_stream_connect+0x3c5/0x1020 net/ipv4/af_inet.c:675 tcp_sendmsg_fastopen+0x3d2/0x700 net/ipv4/tcp.c:1024 tcp_sendmsg_locked+0x1ef8/0x3450 net/ipv4/tcp.c:1076 tcp_sendmsg+0x2e/0x40 net/ipv4/tcp.c:1340 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:655 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2194 __do_sys_sendto net/socket.c:2206 [inline] __se_sys_sendto net/socket.c:2202 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2202 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:0x7fd7b227cae9 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:00007fd7b30a70c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fd7b239bf80 RCX: 00007fd7b227cae9 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fd7b22c847a R08: 0000000020b63fe4 R09: 000000000000001c R10: 0000000020008845 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fd7b239bf80 R15: 00007ffdb3892678 Allocated by task 3689: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1026 [inline] __kmalloc+0x60/0x100 mm/slab_common.c:1039 kmalloc include/linux/slab.h:603 [inline] load_elf_phdrs+0x103/0x210 fs/binfmt_elf.c:486 load_elf_binary+0x1485/0x4f10 fs/binfmt_elf.c:960 search_binary_handler fs/exec.c:1739 [inline] exec_binprm fs/exec.c:1781 [inline] bprm_execve fs/exec.c:1856 [inline] bprm_execve+0x7fc/0x1a40 fs/exec.c:1812 kernel_execve+0x3d8/0x4e0 fs/exec.c:2024 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Freed by task 3689: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 load_elf_binary+0x3151/0x4f10 fs/binfmt_elf.c:1272 search_binary_handler fs/exec.c:1739 [inline] exec_binprm fs/exec.c:1781 [inline] bprm_execve fs/exec.c:1856 [inline] bprm_execve+0x7fc/0x1a40 fs/exec.c:1812 kernel_execve+0x3d8/0x4e0 fs/exec.c:2024 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 rxrpc_put_connection+0x1f2/0x220 net/rxrpc/conn_object.c:374 rxrpc_clean_up_local_conns+0x195/0x280 net/rxrpc/conn_client.c:812 rxrpc_destroy_local+0x170/0x310 net/rxrpc/local_object.c:425 rxrpc_io_thread+0xf5c/0x1710 net/rxrpc/io_thread.c:556 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x38/0x230 kernel/workqueue.c:1647 __queue_work+0x5d0/0x1050 kernel/workqueue.c:1799 queue_work_on+0xed/0x110 kernel/workqueue.c:1834 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:170 setup_net+0x64d/0xa40 net/core/net_namespace.c:362 copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x3da/0x930 kernel/fork.c:3435 __do_sys_unshare kernel/fork.c:3506 [inline] __se_sys_unshare kernel/fork.c:3504 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3504 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 The buggy address belongs to the object at ffff888079db0000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 777 bytes to the right of allocated 1024-byte region [ffff888079db0000, ffff888079db0400) The buggy address belongs to the physical page: page:ffffea0001e76c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79db0 head:ffffea0001e76c00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41dc0 ffffea0001f6d000 dead000000000003 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5141, tgid 5141 (kworker/1:7), ts 184213895847, free_ts 183298046572 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:2299 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x340 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1025 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1039 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:720 [inline] neigh_alloc net/core/neighbour.c:487 [inline] ___neigh_create+0x1575/0x2a20 net/core/neighbour.c:641 ip6_finish_output2+0x10b8/0x1700 net/ipv6/ip6_output.c:126 __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] NF_HOOK.constprop.0+0xff/0x570 include/linux/netfilter.h:304 mld_sendpack+0x713/0xd60 net/ipv6/mcast.c:1818 mld_send_cr net/ipv6/mcast.c:2119 [inline] mld_ifc_work+0x756/0xcd0 net/ipv6/mcast.c:2651 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 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x195/0x340 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1117 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x2b7/0xc40 net/ipv6/mcast.c:936 addrconf_join_solict net/ipv6/addrconf.c:2189 [inline] addrconf_dad_begin net/ipv6/addrconf.c:4033 [inline] addrconf_dad_work+0x232/0x13e0 net/ipv6/addrconf.c:4158 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888079db0600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079db0680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888079db0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888079db0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079db0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================