Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/trusted/service_runtime/sys_memory.c

Issue 1264783002: Remove failure for bad mmap address hints. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Dodging copyright presubmit warning Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/syscalls/mem_test.cc » ('j') | tests/syscalls/mem_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/sys_memory.c
diff --git a/src/trusted/service_runtime/sys_memory.c b/src/trusted/service_runtime/sys_memory.c
index 7b0d7033d81a0b7192236b7dc312bb997d656b7a..332f0e08a85828ef0aa121aa4bbc61448e3678ae 100644
--- a/src/trusted/service_runtime/sys_memory.c
+++ b/src/trusted/service_runtime/sys_memory.c
@@ -329,9 +329,14 @@ int32_t NaClSysMmapIntern(struct NaClApp *nap,
* granularity. (Windows.)
*/
if (!NaClIsAllocPageMultiple(usraddr)) {
- NaClLog(2, "NaClSysMmap: address not allocation granularity aligned\n");
- map_result = -NACL_ABI_EINVAL;
- goto cleanup;
+ if ((NACL_ABI_MAP_FIXED & flags) != 0) {
+ NaClLog(2, "NaClSysMmap: address not allocation granularity aligned\n");
+ map_result = -NACL_ABI_EINVAL;
+ goto cleanup;
+ } else {
+ NaClLog(2, "NaClSysMmap: Force alignment of misaligned hint address\n");
+ usraddr = NaClRoundAllocPage(usraddr);
Sean Klein 2015/07/30 21:49:16 Regarding your comment of 0xffffffff as a usraddr
+ }
}
/*
* Offset should be non-negative (nacl_abi_off_t is signed). This
« no previous file with comments | « no previous file | tests/syscalls/mem_test.cc » ('j') | tests/syscalls/mem_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698