Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/trusted/service_runtime/build.scons
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,7 @@ if env.Bit('linux'):
'nacl_bootstrap_prereservation_test.out',
command=env.AddBootstrap(nacl_bootstrap_prereservation_test_exe, []))
env.AddNodeToTestSuite(node, ['small_tests'],
'run_nacl_bootstrap_prereservation_test',
# TODO(crbug.com/1101347): This fails on ARM bots.
is_broken=env.Bit('build_arm')
and not env.UsingEmulator())
'run_nacl_bootstrap_prereservation_test')


# also seems to have issues with windows coverage or VMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ void FindLowestMappedRange(uintptr_t *start, uintptr_t *end) {
fclose(fp);
}

// See FIRST_USER_ADDRESS in kernel. It is supposed to impossible to reserve pages
// lower than this (though sometimes you can due to bugs...) and causes EINVAL.
#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
# define MIN_VALID_ADDRESS (2u * NACL_PAGESIZE)
#else
# define MIN_VALID_ADDRESS 0u
#endif

int IsPageMappable(uintptr_t addr) {
void *retval = mmap((void *) addr, NACL_PAGESIZE, PROT_NONE,
MAP_PRIVATE | MAP_FIXED |
Expand All @@ -64,7 +72,7 @@ int IsPageMappable(uintptr_t addr) {
if (retval != (void *) addr) {
CHECK(MAP_FAILED == retval &&
(EPERM == errno || EACCES == errno ||
(EINVAL == errno && 0 == addr)));
(EINVAL == errno && addr < MIN_VALID_ADDRESS)));
return 0;
}
return 1;
Expand Down