mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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>
This commit is contained in:
parent
1c275925bf
commit
a7ec0f98e3
2 changed files with 62 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue