================================================================== BUG: KASAN: slab-out-of-bounds in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:986 [inline] BUG: KASAN: slab-out-of-bounds in xfrm_state_find+0x63ee/0x6af0 net/xfrm/xfrm_state.c:1229 Read of size 8 at addr ffff888023b83f98 by task syz-executor.1/9174 CPU: 1 PID: 9174 Comm: syz-executor.1 Not tainted 6.7.0-syzkaller-12262-g736b5545d39c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/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:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 __xfrm_state_lookup_all net/xfrm/xfrm_state.c:986 [inline] xfrm_state_find+0x63ee/0x6af0 net/xfrm/xfrm_state.c:1229 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2489 [inline] xfrm_tmpl_resolve+0x36d/0xdf0 net/xfrm/xfrm_policy.c:2534 xfrm_resolve_and_create_bundle+0x144/0x2300 net/xfrm/xfrm_policy.c:2827 xfrm_lookup_with_ifid+0x25f/0x1e70 net/xfrm/xfrm_policy.c:3161 xfrm_lookup net/xfrm/xfrm_policy.c:3290 [inline] xfrm_lookup_route+0x3b/0x200 net/xfrm/xfrm_policy.c:3301 ip_route_output_flow+0x11a/0x150 net/ipv4/route.c:2879 udp_sendmsg+0x1cfa/0x2b40 net/ipv4/udp.c:1216 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:847 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x2ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2724 __do_sys_sendmmsg net/socket.c:2753 [inline] __se_sys_sendmmsg net/socket.c:2750 [inline] __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2750 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fa083a7cda9 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:00007fa082dbd0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fa083bac120 RCX: 00007fa083a7cda9 RDX: 0400000000000354 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007fa083ac947a R08: 0000000000000000 R09: 0000000000000000 R10: 000002873dedf99c R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fa083bac120 R15: 00007ffd8d738bc8 Allocated by task 8905: kasan_save_stack+0x33/0x50 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:372 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x1f9/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] kzalloc include/linux/slab.h:711 [inline] xfrm_hash_alloc+0xc5/0xf0 net/xfrm/xfrm_hash.c:21 xfrm_hash_resize+0x8c/0x22a0 net/xfrm/xfrm_state.c:167 process_one_work+0x886/0x15d0 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787 kthread+0x2c6/0x3a0 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:242 The buggy address belongs to the object at ffff888023b83e00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 152 bytes to the right of allocated 256-byte region [ffff888023b83e00, ffff888023b83f00) The buggy address belongs to the physical page: page:ffffea00008ee080 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888023b82c00 pfn:0x23b82 head:ffffea00008ee080 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000a40 ffff888013041b40 ffffea0000a75110 ffffea0001f19a90 raw: ffff888023b82c00 000000000010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5102, tgid 5102 (syz-executor.3), ts 178080308741, free_ts 177374329158 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4af/0x19a0 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmalloc_trace+0x30b/0x340 mm/slub.c:4007 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:711 [inline] ____ip_mc_inc_group+0x273/0xcf0 net/ipv4/igmp.c:1452 __ip_mc_inc_group net/ipv4/igmp.c:1487 [inline] ip_mc_inc_group net/ipv4/igmp.c:1493 [inline] ip_mc_up+0x154/0x3b0 net/ipv4/igmp.c:1792 inetdev_event+0xbcd/0x19a0 net/ipv4/devinet.c:1598 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x130 net/core/dev.c:1966 call_netdevice_notifiers_extack net/core/dev.c:2004 [inline] call_netdevice_notifiers net/core/dev.c:2018 [inline] __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8687 dev_change_flags+0x10c/0x160 net/core/dev.c:8725 vlan_device_event+0xdf8/0x2110 net/8021q/vlan.c:468 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 page last free pid 5192 tgid 5192 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x51f/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:324 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3867 ptlock_alloc mm/memory.c:6270 [inline] ptlock_init include/linux/mm.h:2906 [inline] pmd_ptlock_init include/linux/mm.h:3006 [inline] pagetable_pmd_ctor include/linux/mm.h:3044 [inline] pmd_alloc_one include/asm-generic/pgalloc.h:137 [inline] __pmd_alloc+0xc3/0x840 mm/memory.c:5696 pmd_alloc include/linux/mm.h:2805 [inline] __handle_mm_fault+0xa09/0x4900 mm/memory.c:5246 handle_mm_fault+0x47a/0xa10 mm/memory.c:5450 do_user_addr_fault+0x3f8/0x1030 arch/x86/mm/fault.c:1415 handle_page_fault arch/x86/mm/fault.c:1507 [inline] exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 Memory state around the buggy address: ffff888023b83e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888023b83f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888023b83f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888023b84000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888023b84080: fc fc fa fb fb fb fb fb fb fb fc fc fc fc fc fc ==================================================================