[prev in list] [next in list] [prev in thread] [next in thread] 

List:       glibc-cvs
Subject:    [glibc] arm: align stack in clone [BZ 28020]
From:       Szabolcs Nagy via Glibc-cvs <glibc-cvs () sourceware ! org>
Date:       2021-06-28 10:36:21
Message-ID: 20210628103621.3EF993850413 () sourceware ! org
[Download RAW message or body]

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3101b967874fb7d54a23f75fe93c310143e64af6

commit 3101b967874fb7d54a23f75fe93c310143e64af6
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jun 25 19:58:59 2021 +0100

    arm: align stack in clone [BZ 28020]
    
    The arm PCS requires 8 byte aligned stack at function entry.
    Previously unaligned stack could crash the clone child.
    
    Fixes bug 28020.

Diff:
---
 sysdeps/unix/sysv/linux/arm/clone.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S
index 44eefee3fc..05596cb7a5 100644
--- a/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/sysdeps/unix/sysv/linux/arm/clone.S
@@ -31,6 +31,8 @@
 ENTRY(__clone)
 	@ sanity check args
 	cmp	r0, #0
+	@ align sp
+	and	r1, r1, #-8
 	ite	ne
 	cmpne	r1, #0
 	moveq	r0, #-EINVAL
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic