aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/s390
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:08:08 +0100
commite0910f1d3278f05439fb434ee528fc9be1b6bd5e (patch)
tree5f35f75e69506b5867bc3900e0e190561ce197bb /sysdeps/unix/sysv/linux/s390
parentd0724994de40934c552f1f68de89053848a44927 (diff)
downloadglibc-release/2.39/master.tar
glibc-release/2.39/master.tar.gz
glibc-release/2.39/master.tar.bz2
glibc-release/2.39/master.zip
S390: Do not clobber r7 in clone [BZ #31402]release/2.39/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)
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/clone.S1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/clone.S1
2 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
index 4c882ef2ee..a7a863242c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
@@ -53,6 +53,7 @@ ENTRY(__clone)
br %r14
error:
lhi %r2,-EINVAL
+ lm %r6,%r7,24(%r15) /* Load registers. */
j SYSCALL_ERROR_LABEL
PSEUDO_END (__clone)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
index 4eb104be71..c552a6b8de 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)