mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Add syscall sandboxing (seccomp-bpf)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user