================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff8880292f7bac by task syz-executor.2/12855 CPU: 0 PID: 12855 Comm: syz-executor.2 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_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:0x7fea1327cae9 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:00007fea140130c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fea1339bf80 RCX: 00007fea1327cae9 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00007fea132c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fea1339bf80 R15: 00007ffd7d284cb8 Allocated by task 1: 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:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x159/0x400 mm/slab.c:3432 kmem_cache_zalloc include/linux/slab.h:710 [inline] __kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:615 kernfs_new_node+0x94/0x110 fs/kernfs/dir.c:679 __kernfs_create_file+0x53/0x340 fs/kernfs/file.c:1047 sysfs_add_file_mode_ns+0x1ff/0x3b0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x31c/0xb40 fs/sysfs/group.c:152 kernel_add_sysfs_param kernel/params.c:815 [inline] param_sysfs_builtin kernel/params.c:852 [inline] param_sysfs_builtin_init+0x305/0x450 kernel/params.c:986 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5c2/0x900 init/main.c:1547 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff8880292f7ae0 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 36 bytes to the right of allocated 168-byte region [ffff8880292f7ae0, ffff8880292f7b88) The buggy address belongs to the physical page: page:ffffea0000a4bdc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x292f7 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x11() raw: 00fff00000000800 ffff888140064300 ffffea0000a45250 ffffea0000a4c350 raw: 0000000000000000 ffff8880292f7000 0000000100000011 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 30436372261, free_ts 30435749440 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_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] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x3a1/0x400 mm/slab.c:3432 kmem_cache_zalloc include/linux/slab.h:710 [inline] __kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:615 kernfs_new_node fs/kernfs/dir.c:679 [inline] kernfs_create_dir_ns+0x9a/0x210 fs/kernfs/dir.c:1040 internal_create_group+0x780/0xb40 fs/sysfs/group.c:138 kernel_add_sysfs_param kernel/params.c:815 [inline] param_sysfs_builtin kernel/params.c:852 [inline] param_sysfs_builtin_init+0x305/0x450 kernel/params.c:986 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5c2/0x900 init/main.c:1547 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 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 mm_free_pgd kernel/fork.c:803 [inline] __mmdrop+0xd7/0x470 kernel/fork.c:919 mmdrop include/linux/sched/mm.h:54 [inline] __mmput+0x409/0x4d0 kernel/fork.c:1360 mmput+0x62/0x70 kernel/fork.c:1371 free_bprm+0x144/0x3f0 fs/exec.c:1492 kernel_execve+0x3e7/0x4e0 fs/exec.c:2026 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 Memory state around the buggy address: ffff8880292f7a80: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 ffff8880292f7b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880292f7b80: 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 ^ ffff8880292f7c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ffff8880292f7c80: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 ==================================================================