From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, Riku Voipio <riku.voipio@iki.fi>
Subject: [Qemu-devel] [PATCH 0/6] linux-user: Handle SEGV on signal entry/exit correctly
Date: Thu, 28 Jul 2016 16:44:44 +0100 [thread overview]
Message-ID: <1469720690-32060-1-git-send-email-peter.maydell@linaro.org> (raw)
This patchset fixes bugs in our handling of failure to read
or write guest memory on entry and exit from a signal handler.
This is supposed to cause a SIGSEGV, but the guest is permitted
a chance to handle the SIGSEGV (assuming it wasn't generated
in the course of trying to enter a SIGSEGV handler in the first
place). Our current implementation makes the SIGSEGV always
fatal, regardless of whether the guest had a signal handler
set up for it.
The main cause of this bug is that our implementation of
force_sig() had drifted away from the semantics of the kernel
function of that name, so the series renames that to
dump_core_and_abort(), and provides a force_sig() that just
queues a synchronous signal to be taken in the usual way.
The patchset sits on top of my various other pending linux-user
fixes. There are getting to be quite a lot of those now, so
you can find them and this patchset at:
https://git.linaro.org/people/peter.maydell/qemu-arm.git linux-fixes
The test program I used is at
http://people.linaro.org/~peter.maydell/sigaltstack.c
(NB: contains a magic constant that will need tweaking for
non-x86 guests); it arranges to take a SIGSEGV while trying to
take a SIGUSR1.
Although this is a bugfix, it's for a fairly obscure corner
case, so we might want to defer this to 2.8.
thanks
-- PMM
Peter Maydell (6):
linux-user: Recheck for pending synchronous signals too
linux-user: Pass si_type information to queue_signal() explicitly
linux-user: SIGSEGV on signal entry need not be fatal
linux-user: ARM: Give SIGSEGV if signal frame setup fails
linux-user: SIGSEGV from sigreturn need not be fatal
linux-user: Implement force_sigsegv() via force_sig()
linux-user/main.c | 124 ++++++++++++++++-----------------
linux-user/qemu.h | 3 +-
linux-user/signal.c | 189 ++++++++++++++++++++++++++++++---------------------
linux-user/syscall.c | 6 +-
4 files changed, 180 insertions(+), 142 deletions(-)
--
1.9.1
next reply other threads:[~2016-07-28 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 15:44 Peter Maydell [this message]
2016-07-28 15:44 ` [Qemu-devel] [PATCH 1/6] linux-user: Recheck for pending synchronous signals too Peter Maydell
2016-07-28 15:44 ` [Qemu-devel] [PATCH 2/6] linux-user: Pass si_type information to queue_signal() explicitly Peter Maydell
2016-07-28 15:44 ` [Qemu-devel] [PATCH 3/6] linux-user: SIGSEGV on signal entry need not be fatal Peter Maydell
2016-07-28 15:44 ` [Qemu-devel] [PATCH 4/6] linux-user: ARM: Give SIGSEGV if signal frame setup fails Peter Maydell
2016-07-28 15:44 ` [Qemu-devel] [PATCH 5/6] linux-user: SIGSEGV from sigreturn need not be fatal Peter Maydell
2016-07-28 15:44 ` [Qemu-devel] [PATCH 6/6] linux-user: Implement force_sigsegv() via force_sig() Peter Maydell
2016-08-06 2:24 ` [Qemu-devel] [PATCH 0/6] linux-user: Handle SEGV on signal entry/exit correctly Richard Henderson
2016-09-21 18:53 ` Riku Voipio
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=1469720690-32060-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).