diff mbox series

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

Message ID 20210628103856.15407-1-szabolcs.nagy@arm.com
State New
Headers show
Series [COMMITTED] arm: align stack in clone [BZ 28020] | expand

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(+)
diff mbox series

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