================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3383 [inline] BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x19de/0x23e0 net/xfrm/xfrm_policy.c:3489 Read of size 1 at addr ffff8880835c1242 by task syz-executor.2/21543 CPU: 1 PID: 21543 Comm: syz-executor.2 Not tainted 6.1.43-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 decode_session6 net/xfrm/xfrm_policy.c:3383 [inline] __xfrm_decode_session+0x19de/0x23e0 net/xfrm/xfrm_policy.c:3489 xfrm_decode_session_reverse include/net/xfrm.h:1176 [inline] icmpv6_route_lookup+0x44a/0x680 net/ipv6/icmp.c:386 icmp6_send+0x1258/0x20e0 net/ipv6/icmp.c:593 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x37/0x4a0 net/ipv6/route.c:2786 dst_link_failure include/net/dst.h:423 [inline] ip6_tnl_xmit+0x1055/0x28c0 net/ipv6/ip6_tunnel.c:1269 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1385 [inline] ip6_tnl_start_xmit+0xbd7/0x1460 net/ipv6/ip6_tunnel.c:1434 __netdev_start_xmit include/linux/netdevice.h:4853 [inline] netdev_start_xmit include/linux/netdevice.h:4867 [inline] xmit_one net/core/dev.c:3595 [inline] dev_hard_start_xmit+0x261/0x8c0 net/core/dev.c:3611 sch_direct_xmit+0x2b2/0x5e0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0xa7a/0x1fb0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3885 [inline] __dev_queue_xmit+0x1126/0x3c90 net/core/dev.c:4227 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0xf9f/0x15b0 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x6ac/0xa80 net/ipv6/ip6_output.c:206 ip6_send_skb+0x12b/0x240 net/ipv6/ip6_output.c:1989 rawv6_push_pending_frames+0x7a4/0xa00 net/ipv6/raw.c:580 rawv6_sendmsg+0x1754/0x2150 net/ipv6/raw.c:924 sock_sendmsg_nosec net/socket.c:716 [inline] sock_sendmsg net/socket.c:736 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x2a9/0x390 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb07fc7cae9 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:00007fb080a650c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fb07fd9bf80 RCX: 00007fb07fc7cae9 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007fb07fcc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb07fd9bf80 R15: 00007ffc813eb118 Allocated by task 5964: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x50/0x370 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] kmem_cache_alloc_node+0x136/0x310 mm/slub.c:3443 __alloc_skb+0xdf/0x620 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1268 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x24c/0xa90 drivers/net/netdevsim/dev.c:850 process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2292 worker_thread+0xa5f/0x1210 kernel/workqueue.c:2439 kthread+0x26e/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 5964: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x292/0x510 mm/slub.c:3683 nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline] nsim_dev_trap_report_work+0x75d/0xa90 drivers/net/netdevsim/dev.c:850 process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2292 worker_thread+0xa5f/0x1210 kernel/workqueue.c:2439 kthread+0x26e/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff8880835c1140 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 18 bytes to the right of 240-byte region [ffff8880835c1140, ffff8880835c1230) The buggy address belongs to the physical page: page:ffffea00020d7040 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x835c1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88814225c500 raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 5964, tgid 5964 (kworker/0:18), ts 1644580106227, free_ts 1644574950897 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533 prep_new_page mm/page_alloc.c:2540 [inline] get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xa71/0x1080 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] kmem_cache_alloc_node+0x1cf/0x310 mm/slub.c:3443 __alloc_skb+0xdf/0x620 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1268 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x24c/0xa90 drivers/net/netdevsim/dev.c:850 process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2292 worker_thread+0xa5f/0x1210 kernel/workqueue.c:2439 kthread+0x26e/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1460 [inline] free_pcp_prepare mm/page_alloc.c:1510 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388 free_unref_page+0x98/0x570 mm/page_alloc.c:3484 tlb_batch_list_free mm/mmu_gather.c:75 [inline] tlb_finish_mmu+0x119/0x1f0 mm/mmu_gather.c:364 exit_mmap+0x3c3/0x9f0 mm/mmap.c:3226 __mmput+0x115/0x3c0 kernel/fork.c:1191 exit_mm+0x226/0x300 kernel/exit.c:563 do_exit+0x67e/0x2300 kernel/exit.c:856 __do_sys_exit kernel/exit.c:986 [inline] __se_sys_exit kernel/exit.c:984 [inline] __x64_sys_exit+0x3c/0x40 kernel/exit.c:984 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880835c1100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff8880835c1180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880835c1200: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ^ ffff8880835c1280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880835c1300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ==================================================================