================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88801c9c6dda by task syz-executor.2/30566 CPU: 1 PID: 30566 Comm: syz-executor.2 Not tainted 6.6.0-rc5-syzkaller-00055-g1c8b86a3799f #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:1583 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0x584/0x1700 net/ipv6/ip6_output.c:135 ip6_fragment+0x22dd/0x2a40 net/ipv6/ip6_output.c:946 __ip6_finish_output net/ipv6/ip6_output.c:194 [inline] ip6_finish_output+0x803/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 udp_v6_send_skb+0x9b2/0x1900 net/ipv6/udp.c:1282 udpv6_sendmsg+0x24ca/0x2f90 net/ipv6/udp.c:1576 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_sendmsg+0x6ac/0x940 net/socket.c:2558 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2612 __sys_sendmsg+0x117/0x1e0 net/socket.c:2641 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:0x7f5c4e47cae9 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:00007f5c4f17f0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5c4e59bf80 RCX: 00007f5c4e47cae9 RDX: 0000000000000000 RSI: 0000000020001500 RDI: 0000000000000003 RBP: 00007f5c4e4c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f5c4e59bf80 R15: 00007ffeb593f848 Allocated by task 30566: 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+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc_node_track_caller+0x61/0x100 mm/slab_common.c:1043 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:581 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6313 sock_alloc_send_pskb+0x7e4/0x970 net/core/sock.c:2795 sock_alloc_send_skb include/net/sock.h:1885 [inline] __ip6_append_data.isra.0+0x2703/0x47f0 net/ipv6/ip6_output.c:1703 ip6_make_skb+0x304/0x5a0 net/ipv6/ip6_output.c:2096 udpv6_sendmsg+0x247e/0x2f90 net/ipv6/udp.c:1570 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_sendmsg+0x6ac/0x940 net/socket.c:2558 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2612 __sys_sendmsg+0x117/0x1e0 net/socket.c:2641 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 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 netlink_release+0xe44/0x1f90 net/netlink/af_netlink.c:831 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __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] __x64_sys_close+0x87/0xf0 fs/open.c:1557 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 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 netlink_release+0xe44/0x1f90 net/netlink/af_netlink.c:831 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __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] __x64_sys_close+0x87/0xf0 fs/open.c:1557 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 ffff88801c9c6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1498 bytes to the right of allocated 2048-byte region [ffff88801c9c6000, ffff88801c9c6800) The buggy address belongs to the physical page: page:ffffea0000727180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c9c6 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000000800 ffff888012c40800 ffffea0001ee8190 ffffea00007eb2d0 raw: 0000000000000000 ffff88801c9c6000 0000000100000001 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 0x342040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 28651, tgid 28649 (syz-executor.0), ts 1487652101514, free_ts 1487353718120 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] __kmem_cache_alloc_node+0x3c5/0x470 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] mi_init+0x90/0xf0 fs/ntfs3/record.c:105 ntfs_read_mft fs/ntfs3/inode.c:54 [inline] ntfs_iget5+0x462/0x3960 fs/ntfs3/inode.c:532 ntfs_fill_super+0x2ad8/0x4350 fs/ntfs3/super.c:1312 get_tree_bdev+0x3b5/0x650 fs/super.c:1577 vfs_get_tree+0x8c/0x370 fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 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 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_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu mm/mmu_gather.c:300 [inline] tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392 exit_mmap+0x38b/0xa60 mm/mmap.c:3223 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9ad/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1033 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 Memory state around the buggy address: ffff88801c9c6c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801c9c6d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801c9c6d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801c9c6e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801c9c6e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================