jail: SIGSEGV must not be forwarded to the child process
authorLeonardo Mörlein <me@irrelefant.net>
Fri, 8 May 2020 00:58:24 +0000 (02:58 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 15 May 2020 18:10:43 +0000 (19:10 +0100)
A segfault in ujail caused ujail to hang with no chance to abort.
Raising the debug level revealed that SIGSEGV was delivered to
the child process instead of handled directly by ujail. The
corresponding debug message was triggered infinitely again and
again:

forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
forwarding signal 11 to the jailed process
[...]

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
jail/jail.c

index 8ae477c730262414cb06f51bc56105651a96d21f..67d4cadd4f2d887f5a77da04081d9ddbd098423e 100644 (file)
@@ -775,7 +775,7 @@ int main(int argc, char **argv)
 
                if (!sigismember(&sigmask, i))
                        continue;
-               if ((i == SIGCHLD) || (i == SIGPIPE))
+               if ((i == SIGCHLD) || (i == SIGPIPE) || (i == SIGSEGV))
                        continue;
 
                s.sa_handler = jail_handle_signal;