================================================================== 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:4305 Read of size 4 at addr ffffc9000319f198 by task syz.4.1969/12301 CPU: 0 UID: 0 PID: 12301 Comm: syz.4.1969 Not tainted 6.11.0-rc1-syzkaller-00043-g94ede2a3e913 #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:4305 __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:finish_task_switch+0x1ea/0x870 kernel/sched/core.c:5062 Code: c9 50 e8 19 b6 0b 00 48 83 c4 08 4c 89 f7 e8 7d 38 00 00 e9 de 04 00 00 4c 89 f7 e8 00 d5 52 0a e8 0b d7 36 00 fb 48 8b 5d c0 <48> 8d bb f8 15 00 00 48 89 f8 48 c1 e8 03 49 be 00 00 00 00 00 fc RSP: 0018:ffffc9000319ec88 EFLAGS: 00000282 RAX: a4efd061d8acdf00 RBX: ffff888023220000 RCX: ffffffff81701daa RDX: dffffc0000000000 RSI: ffffffff8bead560 RDI: ffffffff8c3f9280 RBP: ffffc9000319ecd0 R08: ffffffff934e9837 R09: 1ffffffff269d306 R10: dffffc0000000000 R11: fffffbfff269d307 R12: 1ffff11017247eeb R13: dffffc0000000000 R14: ffff8880b923e9c0 R15: ffff8880b923f758 context_switch kernel/sched/core.c:5191 [inline] __schedule+0x17b6/0x4a10 kernel/sched/core.c:6529 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6708 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6732 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x130/0x140 kernel/locking/spinlock.c:194 rcu_report_exp_rnp kernel/rcu/tree_exp.h:224 [inline] rcu_preempt_deferred_qs_irqrestore+0x89c/0xc70 kernel/rcu/tree_plugin.h:577 rcu_read_unlock_special+0x470/0x550 kernel/rcu/tree_plugin.h:691 __rcu_read_unlock+0xa1/0x110 kernel/rcu/tree_plugin.h:436 rcu_read_unlock include/linux/rcupdate.h:871 [inline] pte_unmap include/linux/pgtable.h:115 [inline] zap_pte_range mm/memory.c:1688 [inline] zap_pmd_range mm/memory.c:1736 [inline] zap_pud_range mm/memory.c:1765 [inline] zap_p4d_range mm/memory.c:1786 [inline] unmap_page_range+0x38be/0x42c0 mm/memory.c:1807 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1897 exit_mmap+0x264/0xc80 mm/mmap.c:3412 __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 get_signal+0x1695/0x1730 kernel/signal.c:2917 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:0x7f589f377299 Code: Unable to access opcode bytes at 0x7f589f37726f. RSP: 002b:00007f589edff0f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f589f506060 RCX: 00007f589f377299 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f589f506060 RBP: 00007f589f506058 R08: 00007f589edff6c0 R09: 00007f589edff6c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f589f506064 R13: 000000000000006e R14: 00007fff10635720 R15: 00007fff10635808 The buggy address belongs to stack of task syz.4.1969/12301 and is located at offset 88 in frame: rcu_preempt_deferred_qs_irqrestore+0x0/0xc70 This frame has 2 objects: [32, 40) 'flags.i.i.i406' [64, 72) 'flags.i.i.i' The buggy address belongs to the virtual mapping at [ffffc90003198000, ffffc900031a1000) 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:0xffff888047897000 pfn:0x47897 memcg:ffff88802f4c8b02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff888047897000 0000000000000000 00000001ffffffff ffff88802f4c8b02 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 12298, tgid 12298 (syz.4.1969), ts 659218213120, free_ts 658628850336 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:3442 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700 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_clone3 kernel/fork.c:3085 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3064 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 10902 tgid 10902 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:2612 bpf_ringbuf_free kernel/bpf/ringbuf.c:226 [inline] ringbuf_map_free+0xc2/0x120 kernel/bpf/ringbuf.c:235 bpf_map_free_deferred+0xe6/0x110 kernel/bpf/syscall.c:746 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: ffffc9000319f080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000319f100: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 >ffffc9000319f180: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffffc9000319f200: 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 f3 f3 f3 ffffc9000319f280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: c9 leave 1: 50 push %rax 2: e8 19 b6 0b 00 call 0xbb620 7: 48 83 c4 08 add $0x8,%rsp b: 4c 89 f7 mov %r14,%rdi e: e8 7d 38 00 00 call 0x3890 13: e9 de 04 00 00 jmp 0x4f6 18: 4c 89 f7 mov %r14,%rdi 1b: e8 00 d5 52 0a call 0xa52d520 20: e8 0b d7 36 00 call 0x36d730 25: fb sti 26: 48 8b 5d c0 mov -0x40(%rbp),%rbx * 2a: 48 8d bb f8 15 00 00 lea 0x15f8(%rbx),%rdi <-- trapping instruction 31: 48 89 f8 mov %rdi,%rax 34: 48 c1 e8 03 shr $0x3,%rax 38: 49 rex.WB 39: be 00 00 00 00 mov $0x0,%esi 3e: 00 fc add %bh,%ah