diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-03-14 14:36:56 +0000 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2014-03-17 11:44:32 +0200 |
commit | a7ec0f98e3a37a4d31c832cfa14dc2c1c0890421 (patch) | |
tree | e444ff239a0d3947bc2207ae6c4544f2d270eb79 /linux-user/qemu.h | |
parent | 1c275925bfbbc2de84a8f0e09d1dd70bbefb6da3 (diff) | |
download | qemu-a7ec0f98e3a37a4d31c832cfa14dc2c1c0890421.tar.gz qemu-a7ec0f98e3a37a4d31c832cfa14dc2c1c0890421.tar.bz2 qemu-a7ec0f98e3a37a4d31c832cfa14dc2c1c0890421.zip |
linux-user: Don't allow guest to block SIGSEGV
Don't allow the linux-user guest to block SIGSEGV -- QEMU needs this
signal to detect accesses to pages which it has marked read-only
because it has cached translated code from them.
We implement this by making the do_sigprocmask() wrapper suppress
SIGSEGV when doing the host process signal mask manipulation; instead
we store the current state of SIGSEGV in the TaskState struct.
If we get a SIGSEGV for the guest when the guest has blocked the
signal, we treat it as if the default SEGV handler was in place,
as the kernel does for forced SIGSEGV delivery.
This patch is based on an idea by Alex Barcelo, but rather than
simply lying to the guest about the SIGSEGV state we track it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Alex Barcelo <abarcelo@ac.upc.edu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r-- | linux-user/qemu.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 4d24e74775..36d4a738ea 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -126,6 +126,7 @@ typedef struct TaskState { #endif uint32_t stack_base; int used; /* non zero if used */ + bool sigsegv_blocked; /* SIGSEGV blocked by guest */ struct image_info *info; struct linux_binprm *bprm; |