OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 /* | 9 /* |
10 * NaCl Simple/secure ELF loader (NaCl SEL). | 10 * NaCl Simple/secure ELF loader (NaCl SEL). |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "native_client/src/trusted/service_runtime/include/sys/time.h" | 45 #include "native_client/src/trusted/service_runtime/include/sys/time.h" |
46 #include "native_client/src/trusted/service_runtime/nacl_app.h" | 46 #include "native_client/src/trusted/service_runtime/nacl_app.h" |
47 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" | 47 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
48 #include "native_client/src/trusted/service_runtime/nacl_desc_effector_ldr.h" | 48 #include "native_client/src/trusted/service_runtime/nacl_desc_effector_ldr.h" |
49 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 49 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
50 #include "native_client/src/trusted/service_runtime/nacl_resource.h" | 50 #include "native_client/src/trusted/service_runtime/nacl_resource.h" |
51 #include "native_client/src/trusted/service_runtime/nacl_reverse_quota_interface
.h" | 51 #include "native_client/src/trusted/service_runtime/nacl_reverse_quota_interface
.h" |
52 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" | 52 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" |
53 #include "native_client/src/trusted/service_runtime/nacl_syscall_handlers.h" | 53 #include "native_client/src/trusted/service_runtime/nacl_syscall_handlers.h" |
54 #include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h" | 54 #include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h" |
55 #include "native_client/src/trusted/service_runtime/name_service/default_name_se
rvice.h" | |
56 #include "native_client/src/trusted/service_runtime/name_service/name_service.h" | 55 #include "native_client/src/trusted/service_runtime/name_service/name_service.h" |
57 #include "native_client/src/trusted/service_runtime/sel_addrspace.h" | 56 #include "native_client/src/trusted/service_runtime/sel_addrspace.h" |
58 #include "native_client/src/trusted/service_runtime/sel_ldr.h" | 57 #include "native_client/src/trusted/service_runtime/sel_ldr.h" |
59 #include "native_client/src/trusted/service_runtime/sel_memory.h" | 58 #include "native_client/src/trusted/service_runtime/sel_memory.h" |
60 #include "native_client/src/trusted/service_runtime/sel_ldr_thread_interface.h" | 59 #include "native_client/src/trusted/service_runtime/sel_ldr_thread_interface.h" |
61 #include "native_client/src/trusted/simple_service/nacl_simple_rservice.h" | 60 #include "native_client/src/trusted/simple_service/nacl_simple_rservice.h" |
62 #include "native_client/src/trusted/simple_service/nacl_simple_service.h" | 61 #include "native_client/src/trusted/simple_service/nacl_simple_service.h" |
63 #include "native_client/src/trusted/threading/nacl_thread_interface.h" | 62 #include "native_client/src/trusted/threading/nacl_thread_interface.h" |
64 #include "native_client/src/trusted/validator/validation_cache.h" | 63 #include "native_client/src/trusted/validator/validation_cache.h" |
65 | 64 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 goto cleanup_cv; | 214 goto cleanup_cv; |
216 } | 215 } |
217 if (!NaClNameServiceCtor(nap->name_service, | 216 if (!NaClNameServiceCtor(nap->name_service, |
218 NaClAddrSpSquattingThreadIfFactoryFunction, | 217 NaClAddrSpSquattingThreadIfFactoryFunction, |
219 (void *) nap)) { | 218 (void *) nap)) { |
220 free(nap->name_service); | 219 free(nap->name_service); |
221 goto cleanup_cv; | 220 goto cleanup_cv; |
222 } | 221 } |
223 nap->name_service_conn_cap = NaClDescRef(nap->name_service-> | 222 nap->name_service_conn_cap = NaClDescRef(nap->name_service-> |
224 base.base.bound_and_cap[1]); | 223 base.base.bound_and_cap[1]); |
225 if (!NaClDefaultNameServiceInit(nap->name_service)) { | |
226 goto cleanup_name_service; | |
227 } | |
228 | 224 |
229 nap->ignore_validator_result = 0; | 225 nap->ignore_validator_result = 0; |
230 nap->skip_validator = 0; | 226 nap->skip_validator = 0; |
231 nap->validator_stub_out_mode = 0; | 227 nap->validator_stub_out_mode = 0; |
232 | 228 |
233 if (IsEnvironmentVariableSet("NACL_DANGEROUS_ENABLE_FILE_ACCESS")) { | 229 if (IsEnvironmentVariableSet("NACL_DANGEROUS_ENABLE_FILE_ACCESS")) { |
234 NaClInsecurelyBypassAllAclChecks(); | 230 NaClInsecurelyBypassAllAclChecks(); |
235 NaClLog(LOG_INFO, "DANGER: ENABLED FILE ACCESS\n"); | 231 NaClLog(LOG_INFO, "DANGER: ENABLED FILE ACCESS\n"); |
236 } | 232 } |
237 | 233 |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 nacl_global_xlate_base = mem_start; | 1349 nacl_global_xlate_base = mem_start; |
1354 | 1350 |
1355 NaClSandboxMemoryStartForValgrind(mem_start); | 1351 NaClSandboxMemoryStartForValgrind(mem_start); |
1356 | 1352 |
1357 _ovly_debug_event(); | 1353 _ovly_debug_event(); |
1358 } | 1354 } |
1359 | 1355 |
1360 void NaClGdbHook(struct NaClApp const *nap) { | 1356 void NaClGdbHook(struct NaClApp const *nap) { |
1361 StopForDebuggerInit(nap->mem_start); | 1357 StopForDebuggerInit(nap->mem_start); |
1362 } | 1358 } |
OLD | NEW |