================================================================== BUG: KASAN: stack-out-of-bounds in user_mode arch/x86/include/asm/ptrace.h:136 [inline] BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455 Read of size 8 at addr ffffc90005c6fc50 by task syz-executor.0/16990 CPU: 0 PID: 16990 Comm: syz-executor.0 Not tainted 6.2.0-next-20230221-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 user_mode arch/x86/include/asm/ptrace.h:136 [inline] unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455 arch_stack_walk+0x81/0xf0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 irq_work_queue_on+0xd6/0x1a0 kernel/irq_work.c:140 irq_work_single+0x1e4/0x260 kernel/irq_work.c:211 irq_work_run_list kernel/irq_work.c:242 [inline] irq_work_run_list+0x91/0xc0 kernel/irq_work.c:225 irq_work_run+0x58/0xd0 kernel/irq_work.c:251 __sysvec_irq_work+0xce/0x4f0 arch/x86/kernel/irq_work.c:22 sysvec_irq_work+0x92/0xc0 arch/x86/kernel/irq_work.c:17 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:671 RIP: 0010:finish_task_switch.isra.0+0x2bf/0xc80 kernel/sched/core.c:5183 Code: 8b 3a 4c 89 e7 48 c7 02 00 00 00 00 ff d1 4d 85 ff 75 bf 4c 89 e7 e8 10 f8 ff ff e8 eb 8f 32 00 fb 65 48 8b 1c 25 80 b8 03 00 <48> 8d bb 50 15 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 RSP: 0018:ffffc90005c6f820 EFLAGS: 00000202 RAX: 000000000000379b RBX: ffff888021a20000 RCX: 1ffffffff1cf1039 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90005c6f868 R08: 0000000000000001 R09: 0000000000000001 R10: fffffbfff1cf1642 R11: 0000000000000000 R12: ffff8880b983c280 R13: ffff88801fa68000 R14: 0000000000000000 R15: 0000000000000000 context_switch kernel/sched/core.c:5307 [inline] __schedule+0x24bc/0x5ac0 kernel/sched/core.c:6622 preempt_schedule_irq+0x52/0x90 kernel/sched/core.c:6934 irqentry_exit+0x35/0x80 kernel/entry/common.c:432 asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:650 RIP: 0010:lock_release+0x0/0x780 kernel/locking/lockdep.c:5677 Code: 1c 70 00 e9 f4 fe ff ff 48 c7 c7 2c e7 78 8e e8 06 1c 70 00 e9 66 fe ff ff 48 c7 c7 2c e7 78 8e e8 f5 1b 70 00 e9 f0 fd ff ff 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 41 57 41 56 41 55 41 54 RSP: 0018:ffffc90005c6fad8 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffff88801deb6700 RCX: ffffc90005c6fa68 RDX: 0000000000000000 RSI: ffffffff81dd20c1 RDI: ffffffff8c797800 RBP: ffffed1003bd6ce2 R08: 0000000000000001 R09: ffffffff8e78b217 R10: fffffbfff1cf1642 R11: 0000000000000000 R12: ffff88807d18c000 R13: dffffc0000000000 R14: ffff88801deb6710 R15: dffffc0000000000 lockdep_hardirqs_on+0x7d/0x100 kernel/locking/lockdep.c:4384 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:671 RIP: 0010:copy_process+0x0/0x76c0 kernel/fork.c:2018 Code: 5d 41 5c e9 02 2f 39 00 e8 fd 2e 39 00 4c 89 e7 be 03 00 00 00 e8 b0 e6 d0 02 5b 5d 41 5c e9 e7 2e 39 00 0f 1f 80 00 00 00 00 <55> 48 89 e5 41 57 48 8d 85 30 ff ff ff 41 56 49 89 ce 41 55 48 c1 RSP: 0018:ffffc90005c6fc70 EFLAGS: 00000202 ORIG_RAX: ffffffff8beeb140 RAX: ffff888021a20000 RBX: ffff888021a20000 RCX: 1fffffff00000000 RDX: 0000000000000000 RSI: 1ffff92000b8df87 RDI: 0000000041b58ab3 RBP: ffffc90005c6fcb8 R08: 0000000000010000 R09: ffffc900065c8000 R10: 0000000000000000 R11: 0000000000000008 R12: ffff8880b983c280 R13: ffff88801fa68000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to stack of task syz-executor.0/16990 and is located at offset 24 in frame: copy_process+0x0/0x76c0 kernel/fork.c:1692 This frame has 2 objects: [48, 52) 'error' [64, 88) 'delayed' The buggy address belongs to the virtual mapping at [ffffc90005c68000, ffffc90005c71000) created by: kernel_clone+0xeb/0xa10 kernel/fork.c:2684 The buggy address belongs to the physical page: page:ffffea00007bbec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1eefb memcg:ffff88801deb6702 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88801deb6702 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 16942, tgid 16942 (syz-executor.5), ts 2704313722942, free_ts 2645239125400 prep_new_page mm/page_alloc.c:2552 [inline] get_page_from_freelist+0x11bb/0x2d50 mm/page_alloc.c:4339 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5605 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 vm_area_alloc_pages mm/vmalloc.c:2942 [inline] __vmalloc_area_node mm/vmalloc.c:3010 [inline] __vmalloc_node_range+0xb8a/0x1300 mm/vmalloc.c:3180 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:984 [inline] copy_process+0x1320/0x76c0 kernel/fork.c:2100 kernel_clone+0xeb/0xa10 kernel/fork.c:2684 __do_sys_clone+0xba/0x100 kernel/fork.c:2825 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/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:1453 [inline] free_pcp_prepare+0x4de/0x930 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3401 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3496 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2637 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:769 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x17c/0x330 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] keypair_create drivers/net/wireguard/noise.c:100 [inline] wg_noise_handshake_begin_session+0xe6/0xec0 drivers/net/wireguard/noise.c:827 wg_packet_send_handshake_response+0x1fa/0x2f0 drivers/net/wireguard/send.c:96 wg_receive_handshake_packet+0x6d5/0xad0 drivers/net/wireguard/receive.c:154 wg_packet_handshake_receive_worker+0x173/0x3a0 drivers/net/wireguard/receive.c:213 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffffc90005c6fb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90005c6fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90005c6fc00: 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2 00 ^ ffffc90005c6fc80: 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 ffffc90005c6fd00: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 8b 3a mov (%rdx),%edi 2: 4c 89 e7 mov %r12,%rdi 5: 48 c7 02 00 00 00 00 movq $0x0,(%rdx) c: ff d1 callq *%rcx e: 4d 85 ff test %r15,%r15 11: 75 bf jne 0xffffffd2 13: 4c 89 e7 mov %r12,%rdi 16: e8 10 f8 ff ff callq 0xfffff82b 1b: e8 eb 8f 32 00 callq 0x32900b 20: fb sti 21: 65 48 8b 1c 25 80 b8 mov %gs:0x3b880,%rbx 28: 03 00 * 2a: 48 8d bb 50 15 00 00 lea 0x1550(%rbx),%rdi <-- trapping instruction 31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 38: fc ff df 3b: 48 89 fa mov %rdi,%rdx 3e: 48 rex.W 3f: c1 .byte 0xc1