From: Willem Pinckaers <willem_qemu@lekkertech.net>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: [Qemu-trivial] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf
Date: Fri, 07 Nov 2014 19:51:59 -0800 [thread overview]
Message-ID: <545D935F.3070300@lekkertech.net> (raw)
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 <willem_qemu@lekkertech.net>
---
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)
WARNING: multiple messages have this Message-ID (diff)
From: Willem Pinckaers <willem_qemu@lekkertech.net>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf
Date: Fri, 07 Nov 2014 19:51:59 -0800 [thread overview]
Message-ID: <545D935F.3070300@lekkertech.net> (raw)
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 <willem_qemu@lekkertech.net>
---
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)
next reply other threads:[~2014-11-08 13:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 3:51 Willem Pinckaers [this message]
2014-11-08 3:51 ` [Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf Willem Pinckaers
2014-11-08 15:26 ` [Qemu-trivial] " Peter Maydell
2014-11-08 15:26 ` Peter Maydell
2014-11-10 8:18 ` [Qemu-trivial] " Markus Armbruster
2014-11-10 8:18 ` Markus Armbruster
2014-11-11 8:08 ` [Qemu-trivial] " Michael Tokarev
2014-11-11 8:08 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=545D935F.3070300@lekkertech.net \
--to=willem_qemu@lekkertech.net \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.