================================================================== BUG: KASAN: stack-out-of-bounds in xsk_flush net/xdp/xsk.c:331 [inline] BUG: KASAN: stack-out-of-bounds in __xsk_map_flush+0x267/0x310 net/xdp/xsk.c:393 Read of size 8 at addr ffffc900047d7c18 by task syz.0.550/6771 CPU: 1 PID: 6771 Comm: syz.0.550 Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #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:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 xsk_flush net/xdp/xsk.c:331 [inline] __xsk_map_flush+0x267/0x310 net/xdp/xsk.c:393 xdp_do_check_flushed+0x175/0x4e0 net/core/filter.c:4308 __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 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:__sanitizer_cov_trace_switch+0x54/0x90 kernel/kcov.c:340 Code: 41 bd 03 00 00 00 4c 8b 75 00 31 db 4d 85 f6 74 1e 48 8b 74 dd 10 4c 89 e2 4c 89 ef 48 83 c3 01 48 8b 4c 24 28 e8 8c fd ff ff <49> 39 de 75 e2 5b 5d 41 5c 41 5d 41 5e c3 cc cc cc cc 48 83 f8 40 RSP: 0018:ffffc900047d73e0 EFLAGS: 00000297 RAX: 0000000000000002 RBX: 0000000000000003 RCX: ffffffff813d266e RDX: ffff888023552440 RSI: 0000000000000004 RDI: 0000000000000001 RBP: ffffffff8b29d0a0 R08: 0000000000000001 R09: 0000000000000004 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000001 R13: 0000000000000001 R14: 0000000000000003 R15: 0000000000000001 unwind_next_frame+0xebe/0x23a0 arch/x86/kernel/unwind_orc.c:641 __unwind_start+0x5aa/0x880 arch/x86/kernel/unwind_orc.c:760 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xb2/0x170 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4002 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4009 seq_open+0x5b/0x180 fs/seq_file.c:63 __seq_open_private+0x3e/0xd0 fs/seq_file.c:641 seq_open_private+0x24/0x40 fs/seq_file.c:659 mounts_open_common+0x2e8/0x770 fs/proc_namespace.c:271 do_dentry_open+0x91f/0x15f0 fs/open.c:959 vfs_open+0x82/0x3f0 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2141/0x2d20 fs/namei.c:3886 do_filp_open+0x1dc/0x430 fs/namei.c:3913 do_sys_openat2+0x17a/0x1e0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1442 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 RIP: 0033:0x7efdb2374450 Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 79 8d 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 cc 8d 02 00 8b 44 RSP: 002b:00007efdb3157f20 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007efdb2374450 RDX: 0000000000000002 RSI: 00007efdb3157fb0 RDI: 00000000ffffff9c RBP: 00007efdb3157fb0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007efdb2503f60 R15: 00007ffd3f6b5788 The buggy address belongs to stack of task syz.0.550/6771 and is located at offset 24 in frame: do_filp_open+0x0/0x430 fs/namei.c:3381 This frame has 1 object: [48, 280) 'nd' The buggy address belongs to the virtual mapping at [ffffc900047d0000, ffffc900047d9000) created by: kernel_clone+0xfd/0x980 kernel/fork.c:2780 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802e68ac80 pfn:0x2e68a memcg:ffff888042882282 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff88802e68ac80 0000000000000000 00000001ffffffff ffff888042882282 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 6755, tgid 6755 (syz.0.543), ts 106235955647, free_ts 106200649292 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2265 vm_area_alloc_pages mm/vmalloc.c:3583 [inline] __vmalloc_area_node mm/vmalloc.c:3659 [inline] __vmalloc_node_range_noprof+0xa6a/0x1520 mm/vmalloc.c:3840 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:1111 [inline] copy_process+0x2f3b/0x8de0 kernel/fork.c:2203 kernel_clone+0xfd/0x980 kernel/fork.c:2780 __do_sys_clone3+0x1f5/0x270 kernel/fork.c:3084 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 0 tgid 0 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 __folio_put+0x239/0x360 mm/swap.c:129 folio_put include/linux/mm.h:1513 [inline] free_page_and_swap_cache+0x249/0x2c0 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:282 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2843 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 Memory state around the buggy address: ffffc900047d7b00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 ffffc900047d7b80: 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900047d7c00: f1 f1 f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 ^ ffffc900047d7c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900047d7d00: 00 00 00 f3 f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 41 bd 03 00 00 00 mov $0x3,%r13d 6: 4c 8b 75 00 mov 0x0(%rbp),%r14 a: 31 db xor %ebx,%ebx c: 4d 85 f6 test %r14,%r14 f: 74 1e je 0x2f 11: 48 8b 74 dd 10 mov 0x10(%rbp,%rbx,8),%rsi 16: 4c 89 e2 mov %r12,%rdx 19: 4c 89 ef mov %r13,%rdi 1c: 48 83 c3 01 add $0x1,%rbx 20: 48 8b 4c 24 28 mov 0x28(%rsp),%rcx 25: e8 8c fd ff ff call 0xfffffdb6 * 2a: 49 39 de cmp %rbx,%r14 <-- trapping instruction 2d: 75 e2 jne 0x11 2f: 5b pop %rbx 30: 5d pop %rbp 31: 41 5c pop %r12 33: 41 5d pop %r13 35: 41 5e pop %r14 37: c3 ret 38: cc int3 39: cc int3 3a: cc int3 3b: cc int3 3c: 48 83 f8 40 cmp $0x40,%rax