public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.33/master] aarch64: align stack in clone [BZ #27939]
@ 2022-01-26 21:52 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2022-01-26 21:52 UTC (permalink / raw)
  To: glibc-cvs

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

commit d251ad533e4eeaef6e5064b0212f36a3853f18bf
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Jun 1 09:23:40 2021 +0100

    aarch64: align stack in clone [BZ #27939]
    
    The AArch64 PCS requires 16 byte aligned stack.  Previously if the
    caller passed an unaligned stack to clone then the child crashed.
    
    Fixes bug 27939.
    
    (cherry picked from commit 3842ba494963b1d76ad5f68b8d1e5c2279160e31)

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

diff --git a/sysdeps/unix/sysv/linux/aarch64/clone.S b/sysdeps/unix/sysv/linux/aarch64/clone.S
index c9e63bae48..fe04bce6b6 100644
--- a/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ b/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -47,6 +47,8 @@ ENTRY(__clone)
 	/* Sanity check args.  */
 	mov	x0, #-EINVAL
 	cbz	x10, .Lsyscall_error
+	/* Align sp.  */
+	and	x1, x1, -16
 	cbz	x1, .Lsyscall_error
 
 	/* Do the system call.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-26 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 21:52 [glibc/release/2.33/master] aarch64: align stack in clone [BZ #27939] Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).