================================================================== BUG: KASAN: stack-out-of-bounds in bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] BUG: KASAN: stack-out-of-bounds in xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4298 Read of size 4 at addr ffffc90009a1f7f8 by task syz-executor296/5579 CPU: 1 UID: 0 PID: 5579 Comm: syz-executor296 Not tainted 6.10.0-syzkaller-12030-g66ebbdfdeb09 #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 bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4298 __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+0x2c4/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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 be 62 65 f6 f6 44 24 21 02 75 52 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 b3 af d0 f5 65 8b 05 f4 a5 71 74 85 c0 74 43 48 c7 04 24 0e 36 RSP: 0018:ffffc90009a1f7c0 EFLAGS: 00000206 RAX: 42ea59151d925500 RBX: 1ffff92001343efc RCX: ffffffff81701eba RDX: dffffc0000000000 RSI: ffffffff8bcad5a0 RDI: 0000000000000001 RBP: ffffc90009a1f850 R08: ffffffff92fcd85f R09: 1ffffffff25f9b0b R10: dffffc0000000000 R11: fffffbfff25f9b0c R12: dffffc0000000000 R13: 1ffff92001343ef8 R14: ffffc90009a1f7e0 R15: 0000000000000246 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] unlock_page_lruvec_irqrestore include/linux/memcontrol.h:1523 [inline] folio_batch_move_lru+0x42b/0x4e0 mm/swap.c:221 lru_add_drain_cpu+0x10e/0x8c0 mm/swap.c:661 lru_add_drain+0x123/0x3e0 mm/swap.c:775 exit_mmap+0x22b/0xc80 mm/mmap.c:3377 __mmput+0x115/0x380 kernel/fork.c:1345 exit_mm+0x220/0x310 kernel/exit.c:571 do_exit+0x9b2/0x27f0 kernel/exit.c:869 do_group_exit+0x207/0x2c0 kernel/exit.c:1031 __do_sys_exit_group kernel/exit.c:1042 [inline] __se_sys_exit_group kernel/exit.c:1040 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1040 x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232 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:0x7fbf4109f7b9 Code: Unable to access opcode bytes at 0x7fbf4109f78f. RSP: 002b:00007fffe03d8188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbf4109f7b9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007fbf41119390 R08: ffffffffffffffb8 R09: 00007fffe03d8210 R10: 00007fffe03d8210 R11: 0000000000000246 R12: 00007fbf41119390 R13: 0000000000000000 R14: 00007fbf4111ae60 R15: 00007fbf41068cd0 The buggy address belongs to stack of task syz-executor296/5579 and is located at offset 56 in frame: _raw_spin_unlock_irqrestore+0x0/0x140 kernel/locking/spinlock.c:187 This frame has 1 object: [32, 40) 'flags.i.i.i.i' The buggy address belongs to the virtual mapping at [ffffc90009a18000, ffffc90009a21000) created by: copy_process+0x5d1/0x3dc0 kernel/fork.c:2204 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a485 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 5081, tgid 5081 (syz-executor296), ts 66353864482, free_ts 64393166489 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_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263 vm_area_alloc_pages mm/vmalloc.c:3584 [inline] __vmalloc_area_node mm/vmalloc.c:3660 [inline] __vmalloc_node_range_noprof+0x971/0x1460 mm/vmalloc.c:3841 alloc_thread_stack_node kernel/fork.c:313 [inline] dup_task_struct+0x444/0x8c0 kernel/fork.c:1113 copy_process+0x5d1/0x3dc0 kernel/fork.c:2204 kernel_clone+0x223/0x870 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 page last free pid 927 tgid 927 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2608 vfree+0x186/0x2e0 mm/vmalloc.c:3364 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3285 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffffc90009a1f680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90009a1f700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90009a1f780: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3 ^ ffffc90009a1f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90009a1f880: 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 9c pushf 1: 8f 44 24 20 pop 0x20(%rsp) 5: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1) a: 74 08 je 0x14 c: 4c 89 f7 mov %r14,%rdi f: e8 be 62 65 f6 call 0xf66562d2 14: f6 44 24 21 02 testb $0x2,0x21(%rsp) 19: 75 52 jne 0x6d 1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 b3 af d0 f5 call 0xf5d0afe2 <-- trapping instruction 2f: 65 8b 05 f4 a5 71 74 mov %gs:0x7471a5f4(%rip),%eax # 0x7471a62a 36: 85 c0 test %eax,%eax 38: 74 43 je 0x7d 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss