From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: 0062-ps/display.c: Always exit from signal_handler(). X-Git-Tag: v4.0.0~534 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bd4f0b6d7e058197ccf4234f2a0bcc17550d0a6;p=procps-ng 0062-ps/display.c: Always exit from signal_handler(). Right now, "we _exit() anyway" is not always true: for example, the default action for SIGURG is to ignore the signal, which means that "kill(getpid(), signo);" does not terminate the process. Call _exit() explicitly, in this case (rather than exit(), because the terminating kill() calls do not call the functions registered with atexit() either). --- diff --git a/ps/display.c b/ps/display.c index 5cfee84b..a7eee15e 100644 --- a/ps/display.c +++ b/ps/display.c @@ -62,6 +62,7 @@ static void signal_handler(int signo){ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug")); signal(signo, SIG_DFL); /* allow core file creation */ kill(getpid(), signo); + _exit(EXIT_FAILURE); } }