]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: don't ignore SIG{BUS,FPE,ILL,SEGV} during signal processing
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 7 Jun 2018 07:49:04 +0000 (09:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Jun 2018 16:22:43 +0000 (18:22 +0200)
We don't have any reason of blocking those signals.

If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are generated while they are blocked, the
result is undefined, unless the signal was generated by kill(2), sigqueue(3), or
raise(3).

This should be backported to 1.8.

src/signal.c

index f1f682188353752af70500de9a06bbade6bc3cb1..0dadd762c106e129e3c3b69dea577111e0ad62fe 100644 (file)
@@ -120,6 +120,14 @@ int signal_init()
 
        sigfillset(&blocked_sig);
        sigdelset(&blocked_sig, SIGPROF);
+       /* man sigprocmask: If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are
+          generated while they are blocked, the result is undefined, unless
+          the signal was generated by kill(2),
+          sigqueue(3), or raise(3) */
+       sigdelset(&blocked_sig, SIGBUS);
+       sigdelset(&blocked_sig, SIGFPE);
+       sigdelset(&blocked_sig, SIGILL);
+       sigdelset(&blocked_sig, SIGSEGV);
        for (sig = 0; sig < MAX_SIGNAL; sig++)
                LIST_INIT(&signal_state[sig].handlers);