From f730a86d225700d26218c2ffe4fa8df4e4bf1fae Mon Sep 17 00:00:00 2001 From: liwenxiang1 Date: Fri, 18 Jul 2025 15:06:54 +0800 Subject: [PATCH] arch/x64: Fix crash issue after enabling KASAN After up_fork calls the x86_64_fork function, the rsp must be 16-byte aligned; otherwise, the movaps %xmm0, (%rsp) instruction may cause a crash. Signed-off-by: liwenxiang1 --- arch/x86_64/src/common/fork.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86_64/src/common/fork.S b/arch/x86_64/src/common/fork.S index f526a5fa956..1621b560474 100644 --- a/arch/x86_64/src/common/fork.S +++ b/arch/x86_64/src/common/fork.S @@ -118,10 +118,14 @@ up_fork: pushq %r12 movq %rsp, %rdi + subq $8, %rsp + /* call function */ callq x86_64_fork + addq $8, %rsp + /* Do not modify return value %rax */ /* Restore non-volatile registers */