================================================================== 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+0x5fc1/0x6dc0 net/xfrm/xfrm_state.c:1229 Read of size 8 at addr ffff888020b7d6b8 by task syz-executor.2/11075 CPU: 1 PID: 11075 Comm: syz-executor.2 Not tainted 6.6.0-syzkaller-10265-gbabe393974de #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 __xfrm_state_lookup_all net/xfrm/xfrm_state.c:986 [inline] xfrm_state_find+0x5fc1/0x6dc0 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/0x22f0 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 ip6_dst_lookup_flow+0x15c/0x1c0 net/ipv6/ip6_output.c:1256 rawv6_sendmsg+0xd95/0x4060 net/ipv6/raw.c:892 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:2588 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2642 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2728 __do_sys_sendmmsg net/socket.c:2757 [inline] __se_sys_sendmmsg net/socket.c:2754 [inline] __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2754 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f18a867cae9 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:00007f18a94630c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f18a879c050 RCX: 00007f18a867cae9 RDX: 00000000000002e9 RSI: 0000000020000480 RDI: 0000000000000005 RBP: 00007f18a86c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f18a879c050 R15: 00007ffdbba7e7f8 Allocated by task 1782: 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:1007 [inline] __kmalloc+0x60/0x100 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [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+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:242 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+0xb77/0x1050 kernel/workqueue.c:1803 call_timer_fn+0x193/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x585/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __do_softirq+0x21a/0x968 kernel/softirq.c:553 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 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2667 pwq_release_workfn+0x244/0x380 kernel/workqueue.c:4138 kthread_worker_fn+0x2ff/0xac0 kernel/kthread.c:823 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:242 The buggy address belongs to the object at ffff888020b7d400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes to the right of allocated 512-byte region [ffff888020b7d400, ffff888020b7d600) The buggy address belongs to the physical page: page:ffffea000082df00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20b7c head:ffffea000082df00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888013041c80 ffffea0000970000 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8062251196, free_ts 0 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_page_interleave+0x1e/0x250 mm/mempolicy.c:2136 alloc_pages+0x22a/0x270 mm/mempolicy.c:2298 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/0x330 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] device_private_init drivers/base/core.c:3469 [inline] device_add+0xd02/0x1aa0 drivers/base/core.c:3520 device_create_groups_vargs+0x1f4/0x270 drivers/base/core.c:4311 device_create+0xe9/0x120 drivers/base/core.c:4350 mon_bin_add+0xba/0x160 drivers/usb/mon/mon_bin.c:1366 mon_bus_init+0x18e/0x320 drivers/usb/mon/mon_main.c:302 mon_bus_add drivers/usb/mon/mon_main.c:199 [inline] mon_notify+0x32e/0x490 drivers/usb/mon/mon_main.c:230 page_owner free stack trace missing Memory state around the buggy address: ffff888020b7d580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888020b7d600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888020b7d680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888020b7d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020b7d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================