From: Aurelien Jarno <aurelien@aurel32.net>
To: libc-stable@sourceware.org
Cc: Szabolcs Nagy <szabolcs.nagy@arm.com>
Subject: [COMMITTED 2.33] aarch64: align stack in clone [BZ #27939]
Date: Wed, 26 Jan 2022 22:54:02 +0100 [thread overview]
Message-ID: <20220126215402.1392635-1-aurelien@aurel32.net> (raw)
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
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)
---
sysdeps/unix/sysv/linux/aarch64/clone.S | 2 ++
1 file changed, 2 insertions(+)
This fixes a failure in the recently backported commit CVE-2021-3999
fix.
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. */
--
2.34.1
reply other threads:[~2022-01-26 21:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220126215402.1392635-1-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=libc-stable@sourceware.org \
--cc=szabolcs.nagy@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).