================================================================== 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 ffffc90003847a50 by task syz.1.481/7096 CPU: 3 UID: 0 PID: 7096 Comm: syz.1.481 Not tainted 6.10.0-syzkaller-12381-gc33ffdb70cc6 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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+0x216/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 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:check_kcov_mode kernel/kcov.c:175 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x2d/0x60 kernel/kcov.c:207 Code: fa 65 48 8b 15 94 54 79 7e 65 8b 05 95 54 79 7e a9 00 01 ff 00 48 8b 34 24 74 0f f6 c4 01 74 35 8b 82 1c 16 00 00 85 c0 74 2b <8b> 82 f8 15 00 00 83 f8 02 75 20 48 8b 8a 00 16 00 00 8b 92 fc 15 RSP: 0018:ffffc900038475f8 EFLAGS: 00000246 RAX: 0000000080000001 RBX: 000000000004244e RCX: ffffffff81cfb36e RDX: ffff8880230f8000 RSI: ffffffff81cfb37c RDI: 0000000000000006 RBP: 000000000001322e R08: 0000000000000006 R09: 000000000001322e R10: 000000000004244e R11: 0000000000000000 R12: 1ffff92000708ec0 R13: ffffea0001091380 R14: 00007f4191570000 R15: 0000000000000000 vm_normal_page+0x13c/0x2b0 mm/memory.c:655 zap_present_ptes mm/memory.c:1546 [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+0xecb/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:3412 __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:0x7f4192975f19 Code: Unable to access opcode bytes at 0x7f4192975eef. RSP: 002b:00007f41936900f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f4192b05f68 RCX: 00007f4192975f19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f4192b05f68 RBP: 00007f4192b05f60 R08: 00007f41936906c0 R09: 00007f41936906c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4192b05f6c R13: 000000000000000b R14: 00007ffcb3c91400 R15: 00007ffcb3c914e8 The buggy address belongs to stack of task syz.1.481/7096 and is located at offset 24 in frame: exit_mmap+0x0/0xb20 mm/mmap.c:3232 This frame has 2 objects: [32, 96) 'vmi' [128, 256) 'tlb' The buggy address belongs to the virtual mapping at [ffffc90003840000, ffffc90003849000) 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:0xffff888026c87600 pfn:0x26c84 memcg:ffff888024ee7802 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff888026c87600 0000000000000000 00000001ffffffff ffff888024ee7802 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 2, tgid 2 (kthreadd), ts 115406956920, free_ts 113442992649 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 kernel_thread+0xc0/0x100 kernel/fork.c:2843 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x4ef/0x7d0 kernel/kthread.c:765 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 11 tgid 11 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2608 __folio_put+0x31c/0x3e0 mm/swap.c:128 kvfree+0x47/0x50 mm/util.c:696 device_release+0xa1/0x240 drivers/base/core.c:2581 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fa/0x5b0 lib/kobject.c:737 netdev_run_todo+0x7bc/0x12d0 net/core/dev.c:10760 ieee80211_unregister_hw+0x158/0x3a0 net/mac80211/main.c:1679 mac80211_hwsim_del_radio drivers/net/wireless/virtual/mac80211_hwsim.c:5625 [inline] hwsim_exit_net+0x3ad/0x7d0 drivers/net/wireless/virtual/mac80211_hwsim.c:6505 ops_exit_list+0xb0/0x180 net/core/net_namespace.c:173 cleanup_net+0x5b7/0xbf0 net/core/net_namespace.c:640 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/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: ffffc90003847900: 00 f2 f2 f2 00 f2 f2 f2 00 00 f2 f2 00 00 00 00 ffffc90003847980: 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 >ffffc90003847a00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 ^ ffffc90003847a80: 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 ffffc90003847b00: 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: fa cli 1: 65 48 8b 15 94 54 79 mov %gs:0x7e795494(%rip),%rdx # 0x7e79549d 8: 7e 9: 65 8b 05 95 54 79 7e mov %gs:0x7e795495(%rip),%eax # 0x7e7954a5 10: a9 00 01 ff 00 test $0xff0100,%eax 15: 48 8b 34 24 mov (%rsp),%rsi 19: 74 0f je 0x2a 1b: f6 c4 01 test $0x1,%ah 1e: 74 35 je 0x55 20: 8b 82 1c 16 00 00 mov 0x161c(%rdx),%eax 26: 85 c0 test %eax,%eax 28: 74 2b je 0x55 * 2a: 8b 82 f8 15 00 00 mov 0x15f8(%rdx),%eax <-- trapping instruction 30: 83 f8 02 cmp $0x2,%eax 33: 75 20 jne 0x55 35: 48 8b 8a 00 16 00 00 mov 0x1600(%rdx),%rcx 3c: 8b .byte 0x8b 3d: 92 xchg %eax,%edx 3e: fc cld 3f: 15 .byte 0x15