================================================================== 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+0x41c/0x4e0 net/core/filter.c:4298 Read of size 4 at addr ffffc900041b7a50 by task syz.5.4529/22973 CPU: 1 UID: 0 PID: 22973 Comm: syz.5.4529 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+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] xdp_do_check_flushed+0x41c/0x4e0 net/core/filter.c:4298 __napi_poll.constprop.0+0xd1/0x550 net/core/dev.c:6774 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0xa92/0x1010 net/core/dev.c:6962 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:srso_alias_safe_ret+0x5/0x7 arch/x86/lib/retpoline.S:174 Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 48 8d 64 24 08 cc e8 f4 ff ff ff 0f 0b cc cc cc cc cc cc cc cc cc cc cc cc cc RSP: 0018:ffffc900041b7690 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffff81d1d5cf RDX: ffff888021285a00 RSI: ffffffff81d1e721 RDI: 0000000000000001 RBP: 800000006851e007 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807f808000 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffc900041b7ab8 page_table_check_pte_clear include/linux/page_table_check.h:49 [inline] ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1284 [inline] get_and_clear_full_ptes include/linux/pgtable.h:678 [inline] zap_present_folio_ptes mm/memory.c:1493 [inline] zap_present_ptes mm/memory.c:1576 [inline] zap_pte_range mm/memory.c:1618 [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+0x21a1/0x3c10 mm/memory.c:1807 unmap_single_vma+0x194/0x2b0 mm/memory.c:1853 unmap_vmas+0x22f/0x490 mm/memory.c:1897 exit_mmap+0x1b8/0xb20 mm/mmap.c:3382 __mmput+0x12a/0x480 kernel/fork.c:1345 mmput+0x62/0x70 kernel/fork.c:1367 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2bb0 kernel/exit.c:869 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031 get_signal+0x25fd/0x2770 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 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+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9994f75f19 Code: Unable to access opcode bytes at 0x7f9994f75eef. RSP: 002b:00007f9995d740f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f9995105f68 RCX: 00007f9994f75f19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f9995105f68 RBP: 00007f9995105f60 R08: 00007f9995d746c0 R09: 00007f9995d746c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9995105f6c R13: 000000000000000b R14: 00007ffd213c8d20 R15: 00007ffd213c8e08 The buggy address belongs to stack of task syz.5.4529/22973 and is located at offset 24 in frame: exit_mmap+0x0/0xb20 mm/mmap.c:3202 This frame has 2 objects: [32, 96) 'vmi' [128, 256) 'tlb' The buggy address belongs to the virtual mapping at [ffffc900041b0000, ffffc900041b9000) created by: kernel_clone+0xfd/0x980 kernel/fork.c:2781 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880642aa140 pfn:0x642aa memcg:ffff888016713a02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff8880642aa140 0000000000000000 00000001ffffffff ffff888016713a02 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 22113, tgid 22113 (syz-executor), ts 2166349004545, free_ts 2166214688161 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3438 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4696 alloc_pages_mpol_noprof+0x275/0x610 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+0xa6a/0x1520 mm/vmalloc.c:3841 alloc_thread_stack_node kernel/fork.c:313 [inline] dup_task_struct kernel/fork.c:1113 [inline] copy_process+0x2f3b/0x8de0 kernel/fork.c:2204 kernel_clone+0xfd/0x980 kernel/fork.c:2781 __do_sys_clone+0xba/0x100 kernel/fork.c:2924 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 22938 tgid 22937 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_folios+0x9e9/0x1390 mm/page_alloc.c:2656 folios_put_refs+0x560/0x760 mm/swap.c:1039 free_pages_and_swap_cache+0x45f/0x510 mm/swap_state.c:335 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu mm/mmu_gather.c:373 [inline] tlb_finish_mmu+0x168/0x7b0 mm/mmu_gather.c:465 exit_mmap+0x3d1/0xb20 mm/mmap.c:3395 __mmput+0x12a/0x480 kernel/fork.c:1345 mmput+0x62/0x70 kernel/fork.c:1367 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2bb0 kernel/exit.c:869 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031 get_signal+0x25fd/0x2770 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 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+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc900041b7900: 00 f2 f2 f2 00 f2 f2 f2 00 00 f2 f2 00 00 00 00 ffffc900041b7980: 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 >ffffc900041b7a00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 ^ ffffc900041b7a80: 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 ffffc900041b7b00: 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 ================================================================== vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 UID: 0 PID: 22973 Comm: syz.5.4529 Tainted: G B 6.10.0-syzkaller-12246-g786c8248dbd3 #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 RIP: 0010:bq_flush_to_queue+0x4a/0x530 kernel/bpf/cpumap.c:675 Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 dc 04 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 75 50 4c 89 f2 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e d6 03 00 00 41 8b 06 89 44 24 RSP: 0018:ffffc90000a18c10 EFLAGS: 00010256 RAX: dffffc0000000000 RBX: ffff88807f808158 RCX: ffffffff88d7e309 RDX: 0000000000000000 RSI: ffffffff81b16b26 RDI: ffff88807f808050 RBP: ffff88807f808000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000010 R11: 656e65672d646968 R12: dffffc0000000000 R13: ffff88807f808000 R14: 0000000000000000 R15: ffffc900041b7a78 FS: 0000000000000000(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f262e0d4ca0 CR3: 0000000016f18000 CR4: 0000000000350ef0 Call Trace: __cpu_map_flush+0x7b/0x110 kernel/bpf/cpumap.c:767 xdp_do_check_flushed+0x163/0x4e0 net/core/filter.c:4304 __napi_poll.constprop.0+0xd1/0x550 net/core/dev.c:6774 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0xa92/0x1010 net/core/dev.c:6962 handle_softirqs+0x219/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:srso_alias_safe_ret+0x5/0x7 arch/x86/lib/retpoline.S:174 Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 48 8d 64 24 08 cc e8 f4 ff ff ff 0f 0b cc cc cc cc cc cc cc cc cc cc cc cc cc RSP: 0018:ffffc900041b7690 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffff81d1d5cf RDX: ffff888021285a00 RSI: ffffffff81d1e721 RDI: 0000000000000001 RBP: 800000006851e007 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807f808000 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffc900041b7ab8 page_table_check_pte_clear include/linux/page_table_check.h:49 [inline] ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1284 [inline] get_and_clear_full_ptes include/linux/pgtable.h:678 [inline] zap_present_folio_ptes mm/memory.c:1493 [inline] zap_present_ptes mm/memory.c:1576 [inline] zap_pte_range mm/memory.c:1618 [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+0x21a1/0x3c10 mm/memory.c:1807 unmap_single_vma+0x194/0x2b0 mm/memory.c:1853 unmap_vmas+0x22f/0x490 mm/memory.c:1897 exit_mmap+0x1b8/0xb20 mm/mmap.c:3382 __mmput+0x12a/0x480 kernel/fork.c:1345 mmput+0x62/0x70 kernel/fork.c:1367 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2bb0 kernel/exit.c:869 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031 get_signal+0x25fd/0x2770 kernel/signal.c:2917 arch_do_signal_or_restart+0x90/0x7e0 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+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9994f75f19 Code: Unable to access opcode bytes at 0x7f9994f75eef. RSP: 002b:00007f9995d740f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f9995105f68 RCX: 00007f9994f75f19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f9995105f68 RBP: 00007f9995105f60 R08: 00007f9995d746c0 R09: 00007f9995d746c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9995105f6c R13: 000000000000000b R14: 00007ffd213c8d20 R15: 00007ffd213c8e08 Modules linked in: vkms_vblank_simulate: vblank timer overrun ---[ end trace 0000000000000000 ]--- RIP: 0010:bq_flush_to_queue+0x4a/0x530 kernel/bpf/cpumap.c:675 Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 dc 04 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 75 50 4c 89 f2 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e d6 03 00 00 41 8b 06 89 44 24 vkms_vblank_simulate: vblank timer overrun RSP: 0018:ffffc90000a18c10 EFLAGS: 00010256 RAX: dffffc0000000000 RBX: ffff88807f808158 RCX: ffffffff88d7e309 RDX: 0000000000000000 RSI: ffffffff81b16b26 RDI: ffff88807f808050 RBP: ffff88807f808000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000010 R11: 656e65672d646968 R12: dffffc0000000000 R13: ffff88807f808000 R14: 0000000000000000 R15: ffffc900041b7a78 FS: 0000000000000000(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f262e0d4ca0 CR3: 0000000016f18000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: cc int3 1: cc int3 2: cc int3 3: cc int3 4: cc int3 5: cc int3 6: cc int3 7: cc int3 8: cc int3 9: cc int3 a: cc int3 b: cc int3 c: cc int3 d: cc int3 e: cc int3 f: cc int3 10: cc int3 11: cc int3 12: cc int3 13: cc int3 14: cc int3 15: cc int3 16: cc int3 17: cc int3 18: cc int3 19: cc int3 1a: cc int3 1b: cc int3 1c: cc int3 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: cc int3 22: cc int3 23: cc int3 24: cc int3 25: 48 8d 64 24 08 lea 0x8(%rsp),%rsp * 2a: c3 ret <-- trapping instruction 2b: cc int3 2c: e8 f4 ff ff ff call 0x25 31: 0f 0b ud2 33: cc int3 34: cc int3 35: cc int3 36: cc int3 37: cc int3 38: cc int3 39: cc int3 3a: cc int3 3b: cc int3 3c: cc int3 3d: cc int3 3e: cc int3 3f: cc int3