File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -792,7 +792,7 @@ bool AppInitBasicSetup(const ArgsManager& args)
792
792
return true ;
793
793
}
794
794
795
- bool AppInitParameterInteraction (const ArgsManager& args)
795
+ bool AppInitParameterInteraction (const ArgsManager& args, bool use_syscall_sandbox )
796
796
{
797
797
const CChainParams& chainparams = Params ();
798
798
// ********************************************************* Step 2: parameter interactions
@@ -1058,6 +1058,9 @@ bool AppInitParameterInteraction(const ArgsManager& args)
1058
1058
if (!SetupSyscallSandbox (log_syscall_violation_before_terminating)) {
1059
1059
return InitError (Untranslated (" Installation of the syscall sandbox failed." ));
1060
1060
}
1061
+ if (use_syscall_sandbox) {
1062
+ SetSyscallSandboxPolicy (SyscallSandboxPolicy::INITIALIZATION);
1063
+ }
1061
1064
LogPrintf (" Experimental syscall sandbox enabled (-sandbox=%s): bitcoind will terminate if an unexpected (not allowlisted) syscall is invoked.\n " , sandbox_arg);
1062
1065
}
1063
1066
#endif // USE_SYSCALL_SANDBOX
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ bool AppInitBasicSetup(const ArgsManager& args);
41
41
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
42
42
* @pre Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.
43
43
*/
44
- bool AppInitParameterInteraction (const ArgsManager& args);
44
+ bool AppInitParameterInteraction (const ArgsManager& args, bool use_syscall_sandbox = true );
45
45
/* *
46
46
* Initialization sanity checks: ecc init, sanity checks, dir lock.
47
47
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ class NodeImpl : public Node
90
90
uint32_t getLogCategories () override { return LogInstance ().GetCategoryMask (); }
91
91
bool baseInitialize () override
92
92
{
93
- return AppInitBasicSetup (gArgs ) && AppInitParameterInteraction (gArgs ) && AppInitSanityChecks () &&
93
+ return AppInitBasicSetup (gArgs ) && AppInitParameterInteraction (gArgs , /* use_syscall_sandbox= */ false ) && AppInitSanityChecks () &&
94
94
AppInitLockDataDirectory () && AppInitInterfaces (*m_context);
95
95
}
96
96
bool appInitMain (interfaces::BlockAndHeaderTipInfo* tip_info) override
Original file line number Diff line number Diff line change @@ -823,7 +823,6 @@ bool SetupSyscallSandbox(bool log_syscall_violation_before_terminating)
823
823
return false ;
824
824
}
825
825
}
826
- SetSyscallSandboxPolicy (SyscallSandboxPolicy::INITIALIZATION);
827
826
return true ;
828
827
}
829
828
Original file line number Diff line number Diff line change @@ -45,9 +45,6 @@ void SetSyscallSandboxPolicy(SyscallSandboxPolicy syscall_policy);
45
45
46
46
#if defined(USE_SYSCALL_SANDBOX )
47
47
//! Setup and enable the experimental syscall sandbox for the running process.
48
- //!
49
- //! SetSyscallSandboxPolicy(SyscallSandboxPolicy::INITIALIZATION) is called as part of
50
- //! SetupSyscallSandbox(...).
51
48
[[nodiscard ]] bool SetupSyscallSandbox (bool log_syscall_violation_before_terminating );
52
49
53
50
//! Invoke a disallowed syscall. Use for testing purposes.
You can’t perform that action at this time.
0 commit comments