This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 52ea8d51d522d7013f746748bf84bfc2e9bc042c (commit) from b7ee13d765e5d8da1ef68f0c0777cb5e40fffbf7 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 52ea8d51d522d7013f746748bf84bfc2e9bc042c Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Wed Apr 11 10:35:22 2018 +0200
linux-gen: fdserver: mask signals we don't need
Make fdserver block all signals except those we are interested in, or those that can't be masked, and set default handlers for those left, thus preventing fdserver from executing any signal handlers that the application may have installed prior to forking this process.
Signed-off-by: Josep Puigdemont josep.puigdemont@linaro.org Reviewed-by: Janne Peltonen janne.peltonen@nokia.com Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_fdserver.c b/platform/linux-generic/odp_fdserver.c index 9562ea0c..c88c71cd 100644 --- a/platform/linux-generic/odp_fdserver.c +++ b/platform/linux-generic/odp_fdserver.c @@ -647,6 +647,34 @@ int _odp_fdserver_init_global(void) }
if (server_pid == 0) { /*child */ + sigset_t sigset; + struct sigaction action; + + sigfillset(&sigset); + /* undefined if these are ignored, as per POSIX */ + sigdelset(&sigset, SIGFPE); + sigdelset(&sigset, SIGILL); + sigdelset(&sigset, SIGSEGV); + /* can not be masked */ + sigdelset(&sigset, SIGKILL); + sigdelset(&sigset, SIGSTOP); + /* these we want to handle */ + sigdelset(&sigset, SIGTERM); + if (sigprocmask(SIG_SETMASK, &sigset, NULL) == -1) { + ODP_ERR("Could not set signal mask"); + exit(1); + } + + /* set default handlers for those signals we can handle */ + memset(&action, 0, sizeof(action)); + action.sa_handler = SIG_DFL; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + sigaction(SIGFPE, &action, NULL); + sigaction(SIGILL, &action, NULL); + sigaction(SIGSEGV, &action, NULL); + sigaction(SIGTERM, &action, NULL); + /* TODO: pin the server on appropriate service cpu mask */ /* when (if) we can agree on the usage of service mask */
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_fdserver.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
hooks/post-receive