Bitcoin Core  25.99.0
P2P Digital Currency
syscall_sandbox.h
Go to the documentation of this file.
1 // Copyright (c) 2020-2022 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_UTIL_SYSCALL_SANDBOX_H
6 #define BITCOIN_UTIL_SYSCALL_SANDBOX_H
7 
8 enum class SyscallSandboxPolicy {
9  // 1. Initialization
14 
15  // 2. Steady state (non-initialization, non-shutdown)
17  NET,
22  SCHEDULER,
24  TX_INDEX,
26 
27  // 3. Shutdown
28  SHUTOFF,
29 };
30 
45 
46 #if defined(USE_SYSCALL_SANDBOX)
48 [[nodiscard]] bool SetupSyscallSandbox(bool log_syscall_violation_before_terminating);
49 
51 void TestDisallowedSandboxCall();
52 #endif // defined(USE_SYSCALL_SANDBOX)
53 
54 #endif // BITCOIN_UTIL_SYSCALL_SANDBOX_H
SyscallSandboxPolicy
void SetSyscallSandboxPolicy(SyscallSandboxPolicy syscall_policy)
Force the current thread (and threads created from the current thread) into a restricted-service oper...