[COMMITTED] arm: align stack in clone [BZ 28020]

Message ID 20210628103856.15407-1-szabolcs.nagy@arm.com
State Committed
Commit 3101b967874fb7d54a23f75fe93c310143e64af6
Headers
Series [COMMITTED] arm: align stack in clone [BZ 28020] |

Checks

Context Check Description
dj/TryBot-32bit fail Patch caused testsuite regressions

Commit Message

Szabolcs Nagy June 28, 2021, 10:38 a.m. UTC
  The arm PCS requires 8 byte aligned stack at function entry.
Previously unaligned stack could crash the clone child.

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

Patch

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