================================================================== BUG: KASAN: stack-out-of-bounds in copy_from_kernel_nofault+0xa0/0x2c0 mm/maccess.c:35 Write of size 8 at addr ffffc90006a6fa88 by task syz-executor.4/17204 CPU: 0 PID: 17204 Comm: syz-executor.4 Not tainted 6.1.22-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 copy_from_kernel_nofault+0xa0/0x2c0 mm/maccess.c:35 get_kernel_gp_address arch/x86/kernel/traps.c:590 [inline] __exc_general_protection arch/x86/kernel/traps.c:768 [inline] exc_general_protection+0x312/0x4f0 arch/x86/kernel/traps.c:728 asm_exc_general_protection+0x22/0x30 arch/x86/include/asm/idtentry.h:564 RIP: 0010:bpf_prog_test_run_xdp+0x7ff/0x1130 net/bpf/test_run.c:1398 Code: 89 df 48 8b 74 24 58 e8 0f 2b 00 00 31 ff 44 89 e6 e8 65 9b d0 f8 45 85 e4 74 0a e8 fb 97 d0 f8 e9 57 01 00 00 48 8b 44 24 48 <42> 80 3c 30 00 4c 8b 64 24 10 74 0d 48 8b bc 24 88 00 00 00 e8 f8 RSP: 0018:ffffc90006a6fb80 EFLAGS: 00010246 RAX: 1ffff92000d4df91 RBX: 0000000000000000 RCX: ffff888022179d40 RDX: ffff888022179d40 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90006a6fd30 R08: ffffffff88b8f59b R09: ffffed100442f3a9 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffffff88b8d854 R14: 0000000000000000 R15: ffffc90006a6fc60 bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3628 __sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:4981 __do_sys_bpf kernel/bpf/syscall.c:5067 [inline] __se_sys_bpf kernel/bpf/syscall.c:5065 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5065 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fbe5be8c0f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fbe5cb63168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fbe5bfabf80 RCX: 00007fbe5be8c0f9 RDX: 0000000000000048 RSI: 0000000020000200 RDI: 000000000000000a RBP: 00007fbe5bee7b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe82ee769f R14: 00007fbe5cb63300 R15: 0000000000022000 The buggy address belongs to stack of task syz-executor.4/17204 KASAN internal error: frame info validation failed; invalid marker: 0 The buggy address belongs to the virtual mapping at [ffffc90006a68000, ffffc90006a71000) created by: copy_process+0x637/0x4020 kernel/fork.c:2087 The buggy address belongs to the physical page: page:ffffea000071bec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c6fb memcg:ffff888145d01f02 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888145d01f02 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 17201, tgid 17201 (syz-executor.4), ts 903650785456, free_ts 888834892014 prep_new_page mm/page_alloc.c:2540 [inline] get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559 vm_area_alloc_pages mm/vmalloc.c:2975 [inline] __vmalloc_area_node mm/vmalloc.c:3043 [inline] __vmalloc_node_range+0x962/0x1360 mm/vmalloc.c:3213 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct+0x3e5/0x6d0 kernel/fork.c:977 copy_process+0x637/0x4020 kernel/fork.c:2087 kernel_clone+0x222/0x920 kernel/fork.c:2676 __do_sys_clone kernel/fork.c:2817 [inline] __se_sys_clone kernel/fork.c:2801 [inline] __x64_sys_clone+0x231/0x280 kernel/fork.c:2801 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1460 [inline] free_pcp_prepare mm/page_alloc.c:1510 [inline] free_unref_page_prepare+0xf5e/0x1110 mm/page_alloc.c:3388 free_unref_page_list+0x107/0x810 mm/page_alloc.c:3530 release_pages+0x2836/0x2b40 mm/swap.c:1055 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261 tlb_finish_mmu+0xce/0x1f0 mm/mmu_gather.c:361 exit_mmap+0x2c2/0x8b0 mm/mmap.c:3100 __mmput+0x115/0x3c0 kernel/fork.c:1188 exit_mm+0x226/0x300 kernel/exit.c:563 do_exit+0x67e/0x2300 kernel/exit.c:856 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 get_signal+0x16f7/0x17d0 kernel/signal.c:2858 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffffc90006a6f980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90006a6fa00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 f2 >ffffc90006a6fa80: f2 f2 f2 f2 00 00 f2 f2 00 00 00 f2 f2 f2 f2 f2 ^ ffffc90006a6fb00: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90006a6fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 89 df mov %ebx,%edi 2: 48 8b 74 24 58 mov 0x58(%rsp),%rsi 7: e8 0f 2b 00 00 callq 0x2b1b c: 31 ff xor %edi,%edi e: 44 89 e6 mov %r12d,%esi 11: e8 65 9b d0 f8 callq 0xf8d09b7b 16: 45 85 e4 test %r12d,%r12d 19: 74 0a je 0x25 1b: e8 fb 97 d0 f8 callq 0xf8d0981b 20: e9 57 01 00 00 jmpq 0x17c 25: 48 8b 44 24 48 mov 0x48(%rsp),%rax * 2a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) <-- trapping instruction 2f: 4c 8b 64 24 10 mov 0x10(%rsp),%r12 34: 74 0d je 0x43 36: 48 8b bc 24 88 00 00 mov 0x88(%rsp),%rdi 3d: 00 3e: e8 .byte 0xe8 3f: f8 clc