Skip to content

Commit 783665a

Browse files
slipherillwieckz
andcommitted
Check mmap_min_addr only if using NaCl bootstrap
Check the Linux sysctl vm.mmap_min_addr only when using the NaCl bootstrap (rather than always when using NaCl). Or equivalently, check it only with 32-bit NaCl runtimes. The bootstrap fails to start when the value is too high to due low fixed address mappings. On ARM at least, sel_ldr proper would also fail with a too-high min address since that disturbs the address space layout. On 64-bit there is neither the bootstrap nor 0-based address space layout so it always works. Co-authored-by: Thomas Debesse <dev@illwieckz.net>
1 parent 7ae4ad0 commit 783665a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/engine/framework/VirtualMachine.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ static ExeSupport CheckExeSupport(Str::StringRef probe)
447447

448448
#if defined(DAEMON_NACL_RUNTIME_ENABLED)
449449
static std::pair<Sys::OSHandle, IPC::Socket> CreateNaClVM(std::pair<IPC::Socket, IPC::Socket> pair, Str::StringRef name, bool debug, bool extract, int debugLoader) {
450-
CheckMinAddressSysctlTooLarge();
451450
const std::string& libPath = FS::GetLibPath();
452451
std::vector<const char*> args;
453452
char rootSocketRedir[32];
@@ -579,6 +578,8 @@ static std::pair<Sys::OSHandle, IPC::Socket> CreateNaClVM(std::pair<IPC::Socket,
579578
}
580579

581580
if (useBootstrap) {
581+
CheckMinAddressSysctlTooLarge();
582+
582583
bootstrapPath = FS::Path::Build(naclPath, Str::Format("nacl_helper_bootstrap-%s", arch));
583584

584585
if (FS::RawPath::FileExists(bootstrapPath)) {

0 commit comments

Comments
 (0)