aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2024-02-22 15:03:27 +0100
committerStefan Liebler <stli@linux.ibm.com>2024-02-27 11:05:29 +0100
commit9a1bdd7df731a4bc60f72dbdc1b849e02cfa9c34 (patch)
tree74d1c7ab6a478e8c62a2ba6a44eba21e0ad4796f /sysdeps/unix/sysv/linux/s390/s390-64/clone.S
parent23021eda75eee44b4b2ae350e63dc404dac6407d (diff)
downloadglibc-9a1bdd7df731a4bc60f72dbdc1b849e02cfa9c34.tar
glibc-9a1bdd7df731a4bc60f72dbdc1b849e02cfa9c34.tar.gz
glibc-9a1bdd7df731a4bc60f72dbdc1b849e02cfa9c34.tar.bz2
glibc-9a1bdd7df731a4bc60f72dbdc1b849e02cfa9c34.zip
S390: Do not clobber r7 in clone [BZ #31402]release/2.37/master
Starting with commit e57d8fc97b90127de4ed3e3a9cdf663667580935 "S390: Always use svc 0" clone clobbers the call-saved register r7 in error case: function or stack is NULL. This patch restores the saved registers also in the error case. Furthermore the existing test misc/tst-clone is extended to check all error cases and that clone does not clobber registers in this error case. (cherry picked from commit 02782fd12849b6673cb5c2728cb750e8ec295aa3) Note: Added ia64 __clone2 call to tst-clone.c.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-64/clone.S')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/clone.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
index f1c4288a3d..7b37b18010 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
@@ -54,6 +54,7 @@ ENTRY(__clone)
br %r14
error:
lghi %r2,-EINVAL
+ lmg %r6,%r7,48(%r15) /* Restore registers. */
jg SYSCALL_ERROR_LABEL
PSEUDO_END (__clone)