[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf
From: |
Willem Pinckaers |
Subject: |
[Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf |
Date: |
Fri, 07 Nov 2014 19:51:59 -0800 |
This is a simple patch to change the type of old_env from jmp_buf
to sigjmp_buf. old_env is used by sigsetjmp and as such should be
a sigjmp_buf.
This fixes a stack_chk fail in a OSX 32bit build. Since at least on
OSX sigjmp_buf is four bytes larger then a jmpbuf, resulting in an
overflow in sigsetjmp. Due to variable reordering this overwrites
the stack cookie.
Signed-off-by: Willem Pinckaers <address@hidden>
---
coroutine-sigaltstack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 3de0bb3..63519ff 100644
--- a/coroutine-sigaltstack.c
+++ b/coroutine-sigaltstack.c
@@ -155,7 +155,7 @@ Coroutine *qemu_coroutine_new(void)
stack_t oss;
sigset_t sigs;
sigset_t osigs;
- jmp_buf old_env;
+ sigjmp_buf old_env;
/* The way to manipulate stack is with the sigaltstack function. We
* prepare a stack, with it delivering a signal to ourselves and then
--
1.9.3 (Apple Git-50)
- [Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf,
Willem Pinckaers <=