All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] signal: Preparing safe sigprocmask wrapper on qemu-user
@ 2012-09-29 16:11 Alex Barcelo
  2012-09-29 16:11 ` [Qemu-devel] [PATCH 1/2] signal: added a wrapper for sigprocmask function Alex Barcelo
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alex Barcelo @ 2012-09-29 16:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Alex Barcelo

The first patch creates a sigprocmask wrapper on signal.c for its use in syscall.c

The second patch changes the wrapper to protect sigsegv bit on the signal mask.

Alex Barcelo (2):
  signal: added a wrapper for sigprocmask function
  signal: sigsegv protection on do_sigprocmask

 linux-user/qemu.h    |    1 +
 linux-user/signal.c  |   15 +++++++++++++++
 linux-user/syscall.c |   20 ++++++++++----------
 3 files changed, 26 insertions(+), 10 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [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] signal: added a wrapper for sigprocmask function Peter Maydell
  0 siblings, 1 reply; 9+ 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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-29 16:11 [Qemu-devel] [PATCH 0/2] signal: Preparing safe sigprocmask wrapper on qemu-user Alex Barcelo
2012-09-29 16:11 ` [Qemu-devel] [PATCH 1/2] signal: added a wrapper for sigprocmask function Alex Barcelo
2012-10-10 15:48   ` Peter Maydell
2012-09-29 16:11 ` [Qemu-devel] [PATCH 2/2] signal: sigsegv protection on do_sigprocmask Alex Barcelo
2012-10-10 15:54   ` Peter Maydell
2012-10-08 18:42 ` [Qemu-devel] [PATCH 0/2] signal: Preparing safe sigprocmask wrapper on qemu-user Alex Barcelo
2012-10-10 15:37   ` Peter Maydell
2012-10-17 14:22     ` Alex Barcelo
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] signal: added a wrapper for sigprocmask function Peter Maydell

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.