qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] signal: sigsegv protection on do_sigprocmask


From: Alex Barcelo
Subject: [Qemu-devel] [PATCH 2/2] signal: sigsegv protection on do_sigprocmask
Date: Sat, 29 Sep 2012 18:11:26 +0200

The sigsegv protection is done by forcing the catch (needed in qemu-user) 
and then taking it off from the return mask (well, adding it in fact)

---
 linux-user/signal.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index b8b8268..8764f57 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -5468,7 +5468,14 @@ long do_rt_sigreturn(CPUArchState *env)
  */
 int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
 {
-    return sigprocmask(how, set, oldset);
+    int ret;
+    sigset_t temp = *set;
+    if (set) {
+        sigdelset(&temp, SIGSEGV);
+    }
+    ret = sigprocmask(how, &temp, oldset);
+    sigaddset(oldset, SIGSEGV);
+    return ret;
 }
 
 void process_pending_signals(CPUArchState *cpu_env)
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]