================================================================== 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 ffffc90005467c18 by task syz.3.1078/9478 CPU: 1 UID: 0 PID: 9478 Comm: syz.3.1078 Not tainted 6.10.0-syzkaller-12708-g2f8c4f506285 #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 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:4315 __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:tomoyo_path_matches_pattern+0x196/0x280 security/tomoyo/util.c:946 Code: c6 e8 2e d7 45 fd 85 db 75 94 e8 25 dc 45 fd 49 8d 34 2e 49 8d 7c 2d 00 e8 b7 d9 ff ff 41 89 c4 e9 7c ff ff ff e8 0a dc 45 fd <48> 8d 7d 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f RSP: 0018:ffffc90005467688 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffff88801dddfd98 RCX: ffffffff8444b5be RDX: ffff888111ea4880 RSI: ffffffff8444b6c6 RDI: 0000000000000001 RBP: ffffc900054677b8 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffff888032df4300 R14: ffff88801dddfda8 R15: 0000000000000000 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_compare_name_union security/tomoyo/file.c:82 [inline] tomoyo_check_path_acl security/tomoyo/file.c:260 [inline] tomoyo_check_path_acl+0x184/0x210 security/tomoyo/file.c:252 tomoyo_check_acl+0x140/0x410 security/tomoyo/domain.c:175 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_permission+0x1ff/0x3b0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x345/0x3b0 security/tomoyo/file.c:780 tomoyo_file_open+0x71/0x90 security/tomoyo/tomoyo.c:334 security_file_open+0x78/0x8b0 security/security.c:2988 do_dentry_open+0x5c7/0x15f0 fs/open.c:946 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:0x7f0c3b575cd0 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:00007f0c3c271f20 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f0c3b575cd0 RDX: 0000000000000002 RSI: 00007f0c3c271fb0 RDI: 00000000ffffff9c RBP: 00007f0c3c271fb0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0c3b706058 R15: 00007ffe3ba7af48 The buggy address belongs to stack of task syz.3.1078/9478 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 [ffffc90005460000, ffffc90005469000) 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:0x200ac pfn:0x5fbaf memcg:ffff88802e3cc382 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 00000000000200ac 0000000000000000 00000001ffffffff ffff88802e3cc382 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 9407, tgid 9407 (syz.0.1055), ts 288028659788, free_ts 287851897431 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_clone3+0x1f5/0x270 kernel/fork.c:3085 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 9403 tgid 9402 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 folio_put include/linux/mm.h:1486 [inline] free_page_and_swap_cache+0x249/0x2c0 mm/swap_state.c:308 __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: ffffc90005467b00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 ffffc90005467b80: 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90005467c00: f1 f1 f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 ^ ffffc90005467c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90005467d00: 00 00 00 f3 f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e8 2e d7 45 fd call 0xfd45d733 5: 85 db test %ebx,%ebx 7: 75 94 jne 0xffffff9d 9: e8 25 dc 45 fd call 0xfd45dc33 e: 49 8d 34 2e lea (%r14,%rbp,1),%rsi 12: 49 8d 7c 2d 00 lea 0x0(%r13,%rbp,1),%rdi 17: e8 b7 d9 ff ff call 0xffffd9d3 1c: 41 89 c4 mov %eax,%r12d 1f: e9 7c ff ff ff jmp 0xffffffa0 24: e8 0a dc 45 fd call 0xfd45dc33 * 29: 48 8d 7d 08 lea 0x8(%rbp),%rdi <-- trapping instruction 2d: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 34: fc ff df 37: 48 89 fa mov %rdi,%rdx 3a: 48 c1 ea 03 shr $0x3,%rdx 3e: 0f .byte 0xf