OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/nacl/loader/nacl_listener.h" | 5 #include "components/nacl/loader/nacl_listener.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 args->enable_dyncode_syscalls = params.enable_dyncode_syscalls; | 345 args->enable_dyncode_syscalls = params.enable_dyncode_syscalls; |
346 if (!params.enable_dyncode_syscalls) { | 346 if (!params.enable_dyncode_syscalls) { |
347 // Bound the initial nexe's code segment size under PNaCl to | 347 // Bound the initial nexe's code segment size under PNaCl to |
348 // reduce the chance of a code spraying attack succeeding (see | 348 // reduce the chance of a code spraying attack succeeding (see |
349 // https://code.google.com/p/nativeclient/issues/detail?id=3572). | 349 // https://code.google.com/p/nativeclient/issues/detail?id=3572). |
350 // We assume that !params.enable_dyncode_syscalls is synonymous | 350 // We assume that !params.enable_dyncode_syscalls is synonymous |
351 // with PNaCl. We can't apply this arbitrary limit outside of | 351 // with PNaCl. We can't apply this arbitrary limit outside of |
352 // PNaCl because it might break existing NaCl apps, and this limit | 352 // PNaCl because it might break existing NaCl apps, and this limit |
353 // is only useful if the dyncode syscalls are disabled. | 353 // is only useful if the dyncode syscalls are disabled. |
354 args->initial_nexe_max_code_bytes = 32 << 20; // 32 MB | 354 args->initial_nexe_max_code_bytes = 32 << 20; // 32 MB |
| 355 |
| 356 // Only enable the IRT shim ppapi hook for PNaCl pexes (not nexes). |
| 357 // TODO(jvoung): Plumb through something indicating that this is PNaCl |
| 358 // instead of relying on enable_dyncode_syscalls. |
| 359 args->enable_irt_shim = 1; |
355 } | 360 } |
356 #if defined(OS_LINUX) || defined(OS_MACOSX) | 361 #if defined(OS_LINUX) || defined(OS_MACOSX) |
357 args->debug_stub_server_bound_socket_fd = nacl::ToNativeHandle( | 362 args->debug_stub_server_bound_socket_fd = nacl::ToNativeHandle( |
358 params.debug_stub_server_bound_socket); | 363 params.debug_stub_server_bound_socket); |
359 #endif | 364 #endif |
360 #if defined(OS_WIN) | 365 #if defined(OS_WIN) |
361 args->broker_duplicate_handle_func = BrokerDuplicateHandle; | 366 args->broker_duplicate_handle_func = BrokerDuplicateHandle; |
362 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; | 367 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; |
363 #endif | 368 #endif |
364 #if defined(OS_LINUX) | 369 #if defined(OS_LINUX) |
365 args->prereserved_sandbox_size = prereserved_sandbox_size_; | 370 args->prereserved_sandbox_size = prereserved_sandbox_size_; |
366 #endif | 371 #endif |
367 | 372 |
368 #if defined(OS_LINUX) | 373 #if defined(OS_LINUX) |
369 if (params.enable_nonsfi_mode) { | 374 if (params.enable_nonsfi_mode) { |
370 nacl::nonsfi::MainStart(args->imc_bootstrap_handle); | 375 nacl::nonsfi::MainStart(args->imc_bootstrap_handle); |
371 NOTREACHED(); | 376 NOTREACHED(); |
372 return; | 377 return; |
373 } | 378 } |
374 #endif | 379 #endif |
375 NaClChromeMainStartApp(nap, args); | 380 NaClChromeMainStartApp(nap, args); |
376 NOTREACHED(); | 381 NOTREACHED(); |
377 } | 382 } |
OLD | NEW |