Skip to content

Commit 5590945

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 69ba984 commit 5590945

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
@@ -445,7 +445,6 @@ static ExeSupport CheckExeSupport(Str::StringRef probe)
445445

446446
#if defined(DAEMON_NACL_RUNTIME_ENABLED)
447447
static std::pair<Sys::OSHandle, IPC::Socket> CreateNaClVM(std::pair<IPC::Socket, IPC::Socket> pair, Str::StringRef name, bool debug, bool extract, int debugLoader) {
448-
CheckMinAddressSysctlTooLarge();
449448
const std::string& libPath = FS::GetLibPath();
450449
std::vector<const char*> args;
451450
char rootSocketRedir[32];
@@ -577,6 +576,8 @@ static std::pair<Sys::OSHandle, IPC::Socket> CreateNaClVM(std::pair<IPC::Socket,
577576
}
578577

579578
if (useBootstrap) {
579+
CheckMinAddressSysctlTooLarge();
580+
580581
bootstrapPath = FS::Path::Build(naclPath, Str::Format("nacl_helper_bootstrap-%s", arch));
581582

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

0 commit comments

Comments
 (0)