mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 04:29:02 -04:00
On linux, keep track of seccomp tracing properly.
With the new process startup code we must handle the SIGSTOP from the processes if seccomp_tracing is enabled. Otherwise they just hang indefinitely and we assume they failed to start, which is somewhat true.
This commit is contained in:
parent
1af0772ebe
commit
a6677b873f
13
src/worker.c
13
src/worker.c
@ -184,6 +184,9 @@ kore_worker_spawn(u_int16_t idx, u_int16_t id, u_int16_t cpu)
|
||||
{
|
||||
int cnt;
|
||||
struct kore_worker *kw;
|
||||
#if defined(__linux__)
|
||||
int status;
|
||||
#endif
|
||||
|
||||
kw = WORKER(idx);
|
||||
kw->id = id;
|
||||
@ -227,6 +230,16 @@ kore_worker_spawn(u_int16_t idx, u_int16_t id, u_int16_t cpu)
|
||||
if (kw->ready == 1)
|
||||
break;
|
||||
usleep(100000);
|
||||
#if defined(__linux__)
|
||||
/*
|
||||
* If seccomp_tracing is enabled, make sure we
|
||||
* handle the SIGSTOP from the child processes.
|
||||
*/
|
||||
if (kore_seccomp_tracing) {
|
||||
if (waitpid(kw->pid, &status, WNOHANG) > 0)
|
||||
kore_seccomp_trace(kw->pid, status);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (kw->ready == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user