aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-12-18 18:26:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-12-18 18:26:49 +0000
commitc85c564d1442f0bc09a6c80fca025f004e12d044 (patch)
treebb21cd8379494ebf6114d2daa6e97f041e318bbc
parent368b6c8da9f8ae453f5d70f8a62dbf3f1b6d5995 (diff)
downloadglibc-c85c564d1442f0bc09a6c80fca025f004e12d044.zip
glibc-c85c564d1442f0bc09a6c80fca025f004e12d044.tar.gz
glibc-c85c564d1442f0bc09a6c80fca025f004e12d044.tar.bz2
mips32: fix clobbering s0 in setjmp() [BZ #22624]
Similar to commit 1ab47db00dfbc0128119e3503d3ed640ffc4830b ("mips64: fix clobbering s0 in setjmp() [BZ #22624]") as sysdeps/mips/setjmp_aux.c is almost an identical copy of sysdeps/mips/mips64/setjmp_aux.c. [BZ #22624] * sysdeps/mips/setjmp_aux.c (__sigsetjmp_aux): Use inhibit_stack_protector.
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/mips/setjmp_aux.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a71643..31b25ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
2017-12-18 Sergei Trofimovich <slyfox@gentoo.org>
[BZ #22624]
+ * sysdeps/mips/setjmp_aux.c (__sigsetjmp_aux): Use
+ inhibit_stack_protector.
+
+ [BZ #22624]
* sysdeps/mips/mips64/setjmp_aux.c (__sigsetjmp_aux): Use
inhibit_stack_protector.
diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c
index 0052e0c..176243b 100644
--- a/sysdeps/mips/setjmp_aux.c
+++ b/sysdeps/mips/setjmp_aux.c
@@ -23,7 +23,12 @@
pointer. We do things this way because it's difficult to reliably
access them in C. */
+/* Stack protection is disabled to avoid changing s0 (or any other
+ caller-save register) before storing it to environment.
+ See BZ #22624. */
+
int __attribute__ ((nomips16))
+inhibit_stack_protector
__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp)
{
#ifdef __mips_hard_float