mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 20:51:11 +00:00
368b6c8da9
When configured as --enable-stack-protector=all glibc inserts stack checking canary into every function including __sigsetjmp_aux(). Stack checking code ends up using s0 register to temporary hold address of global canary value. Unfortunately __sigsetjmp_aux assumes no caller' caller-save registers should be clobbered as it stores them as-is. The fix is to disable stack protection of __sigsetjmp_aux. Tested on the following test: #include <setjmp.h> #include <stdio.h> int main() { jmp_buf jb; volatile register long s0 asm ("$s0"); s0 = 1234; if (setjmp(jb) == 0) longjmp(jb, 1); printf ("$s0 = %lu\n", s0); } Without the fix: $ qemu-mipsn32 -L . ./mips-longjmp-bug $s0 = 1082346228 With the fix: $ qemu-mipsn32 -L . ./mips-longjmp-bug $s0 = 1234 [BZ #22624] * sysdeps/mips/mips64/setjmp_aux.c (__sigsetjmp_aux): Use inhibit_stack_protector. |
||
---|---|---|
.. | ||
n32 | ||
n64 | ||
__longjmp.c | ||
add_n.S | ||
addmul_1.S | ||
bsd-_setjmp.S | ||
bsd-setjmp.S | ||
e_sqrtl.c | ||
gmp-mparam.h | ||
Implies | ||
libm-test-ulps | ||
libm-test-ulps-name | ||
lshift.S | ||
Makefile | ||
mul_1.S | ||
rshift.S | ||
setjmp_aux.c | ||
setjmp.S | ||
sfp-machine.h | ||
sub_n.S | ||
submul_1.S | ||
Versions |