From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 8AAD53851533; Thu, 27 Oct 2022 13:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AAD53851533 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666878528; bh=o5e2Q++DeuJJvUFKLltGCVUdX+MSG1T672xPKR3fIbU=; h=From:To:Subject:Date:From; b=sMtLHgnc29iuqpqWKBoqx7ThIlVR47I/3/FKH3r437C3mtQZSTBes8m5qE3LGxZqL 68DHxikg1uHcx/iLDveEGiuUswh54PErkR7Oquq9n1Da0gh7KijmTtFVIZ2sSaeGo8 SYmEcuNNKgGza4nxcCBYwErgtWCaaLU2qGcbxZTI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] aarch64: Fix the extension header write in getcontext and swapcontext X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 81a40a16b0e0fdc73046c116ebe31163315aabe9 X-Git-Newrev: d549598009b8f9b795b8d6359f0b2b27418221e3 Message-Id: <20221027134848.8AAD53851533@sourceware.org> Date: Thu, 27 Oct 2022 13:48:48 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d549598009b8f9b795b8d6359f0b2b27418221e3 commit d549598009b8f9b795b8d6359f0b2b27418221e3 Author: Szabolcs Nagy Date: Fri Jul 29 08:00:06 2022 +0100 aarch64: Fix the extension header write in getcontext and swapcontext The extension header is two 32bit words and in the last header both should be 0. There is plenty space in the __reserved area, but it's better not to write more than we mean to. Diff: --- sysdeps/unix/sysv/linux/aarch64/getcontext.S | 4 ++-- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/sysdeps/unix/sysv/linux/aarch64/getcontext.S index 15fbd2d1a0..3109cbd99a 100644 --- a/sysdeps/unix/sysv/linux/aarch64/getcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/getcontext.S @@ -86,8 +86,8 @@ ENTRY(__getcontext) /* Write the termination context extension header. */ add x2, x2, #FPSIMD_CONTEXT_SIZE - str xzr, [x2, #oHEAD + oMAGIC] - str xzr, [x2, #oHEAD + oSIZE] + str wzr, [x2, #oHEAD + oMAGIC] + str wzr, [x2, #oHEAD + oSIZE] /* Grab the signal mask */ /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */ diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S index 1ee2e40272..e3ec9da35d 100644 --- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S @@ -75,8 +75,8 @@ ENTRY(__swapcontext) /* Write the termination context extension header. */ add x2, x2, #FPSIMD_CONTEXT_SIZE - str xzr, [x2, #oHEAD + oMAGIC] - str xzr, [x2, #oHEAD + oSIZE] + str wzr, [x2, #oHEAD + oMAGIC] + str wzr, [x2, #oHEAD + oSIZE] /* Preserve ucp. */ mov x21, x1