diff --git a/src/trusted/service_runtime/posix/addrspace_teardown.c b/src/trusted/service_runtime/posix/addrspace_teardown.c index ca1b089c15..08f0483265 100644 --- a/src/trusted/service_runtime/posix/addrspace_teardown.c +++ b/src/trusted/service_runtime/posix/addrspace_teardown.c @@ -18,6 +18,10 @@ void NaClAddrSpaceFree(struct NaClApp *nap) { uintptr_t addrsp_size = (uintptr_t) 1U << nap->addr_bits; size_t full_size = (NACL_ADDRSPACE_LOWER_GUARD_SIZE + addrsp_size + NACL_ADDRSPACE_UPPER_GUARD_SIZE); + if (g_prereserved_sandbox_size > 0) { + NaClLog(LOG_WARNING, "NaClAddrSpaceFree: can't unmap when memory is prereserved by bootstrap helper\n"); + return; + } if (munmap(base, full_size) != 0) { NaClLog(LOG_FATAL, "NaClAddrSpaceFree: munmap() failed, errno %d\n", errno); diff --git a/src/trusted/service_runtime/sel_addrspace.h b/src/trusted/service_runtime/sel_addrspace.h index ad790048a6..1ec2def6a8 100644 --- a/src/trusted/service_runtime/sel_addrspace.h +++ b/src/trusted/service_runtime/sel_addrspace.h @@ -94,6 +94,9 @@ NaClErrorCode NaClAllocateSpace(void **mem, size_t addrsp_size) NACL_WUR; * * Note that this does not free any other data structures associated * with the NaClApp. In particular, it does not free mem_map. + * + * FIXME: does not work when memory is prereserved by nacl_bootstrap_helper + * since we don't know what vm.mmap_min_addr sysctl was */ void NaClAddrSpaceFree(struct NaClApp *nap); diff --git a/src/trusted/validator_arm/build.scons b/src/trusted/validator_arm/build.scons index 7397eb1646..076acf72e3 100644 --- a/src/trusted/validator_arm/build.scons +++ b/src/trusted/validator_arm/build.scons @@ -265,7 +265,7 @@ validator_tests = { # The following tests generate ARM nexes from assembly and validate the # generate file. They're all expected to fail and produce the golden files' # stdout. Stderr is expected to be empty. -if env.Bit('build_arm'): +if env.Bit('build_arm') and UsingNaclMode(): untrusted_env = env.MakeUntrustedNativeEnv() for test, exit_status in validator_tests.items(): nexe = untrusted_env.ComponentProgram(test, 'testdata/' + test + '.S',