qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] linux-user: Don't allow guest to block SIGSEGV
@ 2014-03-14 14:36 Peter Maydell
  2014-03-14 14:36 ` [Qemu-devel] [PATCH 1/2] linux-user: Add wrapper for guest uses of sigprocmask function Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2014-03-14 14:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Matz, patches, Dann Frazier, Riku Voipio, Alexander Graf,
	Alex Bennée

QEMU uses SIGSEGV for its own purposes (notably for detection of guest
writes to pages marked read-only because we have cached translated code
from them), so allowing the guest to block SIGSEGV is a bad idea.
Instead we wrap sigprocmask() uses for guest-derived signal masks and
just track whether the guest thinks SIGSEGV is blocked rather than
really blocking it.

This is an updated version of a patchset sent by Alex Barcelo a
year or so ago; changes are:
 * use the wrapper for sigprocmask uses in signal.c where we set
   the signal mask on entry and exit from a guest signal handler
 * rather than just dropping SIGSEGV from the signal mask, track
   the guest state in a TaskState flag

Although the need for this patchset is more noticable with AArch64
guests (because at the moment we use trampoline code on the stack
for handling return from signal, which means that pages in the stack
are often marked read-only because we translate the trampoline code
and then written to in the normal course of guest execution) it
is generally applicable to all architectures.

[Eventually we should implement emulation of the vdso for AArch64,
at which point we can put the signal-return trampoline in that,
as the real kernel does; then there will be less of these SEGVs.]

Alex Barcelo (1):
  linux-user: Add wrapper for guest uses of sigprocmask function

Peter Maydell (1):
  linux-user: Don't allow guest to block SIGSEGV

 linux-user/qemu.h    |   2 +
 linux-user/signal.c  | 118 ++++++++++++++++++++++++++++++++++++++++-----------
 linux-user/syscall.c |  14 +++---
 3 files changed, 103 insertions(+), 31 deletions(-)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-14 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 14:36 [Qemu-devel] [PATCH 0/2] linux-user: Don't allow guest to block SIGSEGV Peter Maydell
2014-03-14 14:36 ` [Qemu-devel] [PATCH 1/2] linux-user: Add wrapper for guest uses of sigprocmask function Peter Maydell
2014-03-14 14:36 ` [Qemu-devel] [PATCH 1/2] signal: added a wrapper for " Peter Maydell
2014-03-14 14:36 ` [Qemu-devel] [PATCH 2/2] linux-user: Don't allow guest to block SIGSEGV Peter Maydell

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).