================================================================== 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 ffff888027e0d9e8 by task syz.4.758/7784 CPU: 0 UID: 0 PID: 7784 Comm: syz.4.758 Not tainted 6.10.0-syzkaller-12246-g786c8248dbd3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 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 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202 Code: 90 f3 0f 1e fa 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 0a 2c d5 f5 48 89 df e8 e2 6e d6 f5 e8 dd 41 00 f6 fb bf 01 00 00 00 b2 3a c8 f5 65 8b 05 b3 30 69 74 85 c0 74 06 5b e9 6c 9a 15 00 RSP: 0018:ffffc90003d17c70 EFLAGS: 00000282 RAX: 730dd7a021a14600 RBX: ffff888020d4ca00 RCX: ffffffff947fa903 RDX: dffffc0000000000 RSI: ffffffff8bcad5a0 RDI: 0000000000000001 RBP: ffffc90003d17db0 R08: ffffffff8fafa5ef R09: 1ffffffff1f5f4bd R10: dffffc0000000000 R11: fffffbfff1f5f4be R12: 0000000000000009 R13: ffff888027e0e338 R14: 1ffff11004e776d5 R15: ffff888027e0da00 spin_unlock_irq include/linux/spinlock.h:401 [inline] get_signal+0x131d/0x1740 kernel/signal.c:2881 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd3ea575f19 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:00007fd3eb4360f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fd3ea705f68 RCX: 00007fd3ea575f19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fd3ea705f68 RBP: 00007fd3ea705f60 R08: 00007fd3eb4366c0 R09: 00007fd3eb4366c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd3ea705f6c R13: 000000000000000b R14: 00007ffe2080d480 R15: 00007ffe2080d568 Allocated by task 5108: 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:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080 alloc_task_struct_node kernel/fork.c:179 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1105 copy_process+0x5d1/0x3dc0 kernel/fork.c:2204 kernel_clone+0x226/0x8f0 kernel/fork.c:2781 __do_sys_clone kernel/fork.c:2924 [inline] __se_sys_clone kernel/fork.c:2908 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2908 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 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 task_work_add+0xb8/0x450 kernel/task_work.c:62 task_tick_mm_cid kernel/sched/core.c:10232 [inline] sched_tick+0x322/0x610 kernel/sched/core.c:5471 update_process_times+0x202/0x230 kernel/time/timer.c:2490 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x37c/0x500 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1689 [inline] __hrtimer_run_queues+0x553/0xd50 kernel/time/hrtimer.c:1753 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1815 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x112/0x3f0 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff888027e0bc00 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 [ffff888027e0bc00, ffff888027e0d900) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27e08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807bd19a41 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff888015ef2500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080040004 00000001fdffffff ffff88807bd19a41 head: 00fff00000000040 ffff888015ef2500 dead000000000100 dead000000000122 head: 0000000000000000 0000000080040004 00000001fdffffff ffff88807bd19a41 head: 00fff00000000003 ffffea00009f8201 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 16279723596, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 __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:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x320 mm/slub.c:4080 alloc_task_struct_node kernel/fork.c:179 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1105 copy_process+0x5d1/0x3dc0 kernel/fork.c:2204 kernel_clone+0x226/0x8f0 kernel/fork.c:2781 kernel_thread+0x1bc/0x240 kernel/fork.c:2843 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: ffff888027e0d880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888027e0d900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888027e0d980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888027e0da00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888027e0da80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 90 nop 1: f3 0f 1e fa endbr64 5: 53 push %rbx 6: 48 89 fb mov %rdi,%rbx 9: 48 83 c7 18 add $0x18,%rdi d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi 12: e8 0a 2c d5 f5 call 0xf5d52c21 17: 48 89 df mov %rbx,%rdi 1a: e8 e2 6e d6 f5 call 0xf5d66f01 1f: e8 dd 41 00 f6 call 0xf6004201 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 b2 3a c8 f5 call 0xf5c83ae1 <-- trapping instruction 2f: 65 8b 05 b3 30 69 74 mov %gs:0x746930b3(%rip),%eax # 0x746930e9 36: 85 c0 test %eax,%eax 38: 74 06 je 0x40 3a: 5b pop %rbx 3b: e9 6c 9a 15 00 jmp 0x159aac