mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Add syscall sandboxing (seccomp-bpf)
This commit is contained in:
parent
e69cbac628
commit
4747da3a5b
27 changed files with 1125 additions and 1 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include <shutdown.h>
|
||||
#include <sync.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/syscall_sandbox.h>
|
||||
#include <util/system.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <util/translation.h>
|
||||
|
|
@ -279,6 +280,7 @@ static void http_reject_request_cb(struct evhttp_request* req, void*)
|
|||
static bool ThreadHTTP(struct event_base* base)
|
||||
{
|
||||
util::ThreadRename("http");
|
||||
SetSyscallSandboxPolicy(SyscallSandboxPolicy::NET_HTTP_SERVER);
|
||||
LogPrint(BCLog::HTTP, "Entering http event loop\n");
|
||||
event_base_dispatch(base);
|
||||
// Event loop will be interrupted by InterruptHTTPServer()
|
||||
|
|
@ -332,6 +334,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
|||
static void HTTPWorkQueueRun(WorkQueue<HTTPClosure>* queue, int worker_num)
|
||||
{
|
||||
util::ThreadRename(strprintf("httpworker.%i", worker_num));
|
||||
SetSyscallSandboxPolicy(SyscallSandboxPolicy::NET_HTTP_SERVER_WORKER);
|
||||
queue->Run();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue