]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: fix extension header write in getcontext and swapcontext
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 29 Jul 2022 07:00:06 +0000 (08:00 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 5 Aug 2022 18:45:19 +0000 (19:45 +0100)
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.

sysdeps/unix/sysv/linux/aarch64/getcontext.S
sysdeps/unix/sysv/linux/aarch64/swapcontext.S

index 15fbd2d1a0dacf0d2fa3f3012ba62f86f52336d3..3109cbd99a356fbaa53262d0dc0e480ee43f563c 100644 (file)
@@ -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) */
index 1ee2e40272d9067d0a76e40051252029b49db890..e3ec9da35d7afa6add87b8af3ffe1f646ee9d818 100644 (file)
@@ -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