This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f730a86d225 arch/x64: Fix crash issue after enabling KASAN
f730a86d225 is described below

commit f730a86d225700d26218c2ffe4fa8df4e4bf1fae
Author: liwenxiang1 <[email protected]>
AuthorDate: Fri Jul 18 15:06:54 2025 +0800

    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 <[email protected]>
---
 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 */
 

Reply via email to