[pulseaudio-commits] src/pulse

Arun Raghavan arun at kemper.freedesktop.org
Tue Oct 20 21:15:50 PDT 2015


 src/pulse/thread-mainloop.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 9817f396d5451070ba5c7ae7d11f7cc376911105
Author: Julien Isorce <julien.isorce at gmail.com>
Date:   Mon Oct 19 23:29:53 2015 +0100

    thread-mainloop: keep SIGSYS unblocked if currently trapped
    
    Seccomp-BPF uses SIGSYS signal to trigger
    the trap handler attached to sys_open.
    If the signal is blocked then the kernel kills
    the process whenever pulse audio calls 'open'.
    The result backtrace is terminating in sys_open.
    
    That's why it is required to keep SIGSYS unblocked
    if it is currently unblocked and trapped.
    
    This patch allows to have pulse audio working
    in the Chromium sandbox.
    
    Signed-off-by: Julien Isorce <j.isorce at samsung.com>
    Signed-off-by: Arun Raghavan <git at arunraghavan.net>

diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index afd0581..cbfc474 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -77,10 +77,22 @@ static void thread(void *userdata) {
 
 #ifndef OS_IS_WIN32
     sigset_t mask;
+    sigset_t prev_mask;
+    struct sigaction sa;
 
-    /* Make sure that signals are delivered to the main thread */
     sigfillset(&mask);
-    pthread_sigmask(SIG_BLOCK, &mask, NULL);
+
+    /* If SIGSYS is currently unblocked and trapped then keep it unblocked. */
+    if (!pthread_sigmask(SIG_SETMASK, NULL, &prev_mask) &&
+        !sigismember(&prev_mask, SIGSYS) &&
+        !sigaction(SIGSYS, NULL, &sa)
+        && sa.sa_handler != SIG_DFL) {
+        sigdelset(&mask, SIGSYS);
+    }
+
+    /* Make sure that signals are delivered to the main thread.
+     * Use SIG_SETMASK because SIG_BLOCK does an union with current set.*/
+    pthread_sigmask(SIG_SETMASK, &mask, NULL);
 #endif
 
     pa_mutex_lock(m->mutex);



More information about the pulseaudio-commits mailing list