================================================================== BUG: KASAN: slab-out-of-bounds in xsk_flush net/xdp/xsk.c:331 [inline] BUG: KASAN: slab-out-of-bounds in __xsk_map_flush+0x87/0x2b0 net/xdp/xsk.c:393 Read of size 8 at addr ffff888025fc59e8 by task syz.2.1187/10161 CPU: 1 PID: 10161 Comm: syz.2.1187 Not tainted 6.10.0-syzkaller-08280-g68b59730459e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 xsk_flush net/xdp/xsk.c:331 [inline] __xsk_map_flush+0x87/0x2b0 net/xdp/xsk.c:393 xdp_do_check_flushed+0x18e/0x240 net/core/filter.c:4308 __napi_poll+0xe4/0x490 net/core/dev.c:6774 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:6962 handle_softirqs+0x2c6/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 common_interrupt+0xaa/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:__sanitizer_cov_trace_pc+0x4a/0x70 kernel/kcov.c:213 Code: f7 c2 00 01 00 00 74 35 83 b9 1c 16 00 00 00 74 2c 8b 91 f8 15 00 00 83 fa 02 75 21 48 8b 91 00 16 00 00 48 8b 32 48 8d 7e 01 <8b> 89 fc 15 00 00 48 39 cf 73 08 48 89 3a 48 89 44 f2 08 e9 a9 db RSP: 0018:ffffc90004b8faa8 EFLAGS: 00000246 RAX: ffffffff81ed2841 RBX: ffffc9000ccf8000 RCX: ffff888025fc5a00 RDX: ffffc90009489000 RSI: 000000000000079e RDI: 000000000000079f RBP: ffff888058c6c350 R08: ffffffff81ed27d7 R09: fffff52000971f44 R10: dffffc0000000000 R11: fffff52000971f44 R12: 0000000000000001 R13: ffffc9000ccf3048 R14: dffffc0000000000 R15: ffff8880150631b8 __find_vmap_area mm/vmalloc.c:1006 [inline] find_vmap_area+0x131/0x1b0 mm/vmalloc.c:2404 check_heap_object mm/usercopy.c:177 [inline] __check_object_size+0x298/0x900 mm/usercopy.c:251 check_object_size include/linux/thread_info.h:215 [inline] check_copy_size include/linux/thread_info.h:251 [inline] copy_from_user include/linux/uaccess.h:182 [inline] copy_from_bpfptr_offset include/linux/bpfptr.h:53 [inline] copy_from_bpfptr+0x50/0x90 include/linux/bpfptr.h:59 bpf_prog_load+0xb70/0x20f0 kernel/bpf/syscall.c:2844 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5710 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5815 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f905af75b59 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f905bd06048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f905b105f60 RCX: 00007f905af75b59 RDX: 0000000000000090 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f905afe4e5d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f905b105f60 R15: 00007ffc0b5c9318 Allocated by task 2: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4002 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4045 alloc_task_struct_node kernel/fork.c:178 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1103 copy_process+0x5d1/0x3dc0 kernel/fork.c:2203 kernel_clone+0x226/0x8f0 kernel/fork.c:2780 kernel_thread+0x1bc/0x240 kernel/fork.c:2842 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x60d/0x810 kernel/kthread.c:765 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888025fc3c00 which belongs to the cache task_struct of size 7424 The buggy address is located 232 bytes to the right of allocated 7424-byte region [ffff888025fc3c00, ffff888025fc5900) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25fc0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880296de2c1 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015ee7500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffefff ffff8880296de2c1 head: 00fff00000000040 ffff888015ee7500 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000001ffffefff ffff8880296de2c1 head: 00fff00000000003 ffffea000097f001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2, tgid 2 (kthreadd), ts 13920366367, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2265 allocate_slab+0x5a/0x2f0 mm/slub.c:2428 new_slab mm/slub.c:2481 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3667 __slab_alloc+0x58/0xa0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x320 mm/slub.c:4045 alloc_task_struct_node kernel/fork.c:178 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1103 copy_process+0x5d1/0x3dc0 kernel/fork.c:2203 kernel_clone+0x226/0x8f0 kernel/fork.c:2780 kernel_thread+0x1bc/0x240 kernel/fork.c:2842 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x60d/0x810 kernel/kthread.c:765 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888025fc5880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888025fc5900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888025fc5980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888025fc5a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888025fc5a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: f7 c2 00 01 00 00 test $0x100,%edx 6: 74 35 je 0x3d 8: 83 b9 1c 16 00 00 00 cmpl $0x0,0x161c(%rcx) f: 74 2c je 0x3d 11: 8b 91 f8 15 00 00 mov 0x15f8(%rcx),%edx 17: 83 fa 02 cmp $0x2,%edx 1a: 75 21 jne 0x3d 1c: 48 8b 91 00 16 00 00 mov 0x1600(%rcx),%rdx 23: 48 8b 32 mov (%rdx),%rsi 26: 48 8d 7e 01 lea 0x1(%rsi),%rdi * 2a: 8b 89 fc 15 00 00 mov 0x15fc(%rcx),%ecx <-- trapping instruction 30: 48 39 cf cmp %rcx,%rdi 33: 73 08 jae 0x3d 35: 48 89 3a mov %rdi,(%rdx) 38: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8) 3d: e9 .byte 0xe9 3e: a9 .byte 0xa9 3f: db .byte 0xdb