| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/nacl_process_host.h" | 5 #include "components/nacl/browser/nacl_process_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "components/nacl/browser/nacl_broker_service_win.h" | 69 #include "components/nacl/browser/nacl_broker_service_win.h" |
| 70 #include "components/nacl/common/nacl_debug_exception_handler_win.h" | 70 #include "components/nacl/common/nacl_debug_exception_handler_win.h" |
| 71 #include "content/public/common/sandbox_init.h" | 71 #include "content/public/common/sandbox_init.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 using content::BrowserThread; | 74 using content::BrowserThread; |
| 75 using content::ChildProcessData; | 75 using content::ChildProcessData; |
| 76 using content::ChildProcessHost; | 76 using content::ChildProcessHost; |
| 77 using ppapi::proxy::SerializedHandle; | 77 using ppapi::proxy::SerializedHandle; |
| 78 | 78 |
| 79 namespace nacl { |
| 80 |
| 79 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 80 | |
| 81 namespace { | 82 namespace { |
| 82 | 83 |
| 83 // Looks for the largest contiguous unallocated region of address | 84 // Looks for the largest contiguous unallocated region of address |
| 84 // space and returns it via |*out_addr| and |*out_size|. | 85 // space and returns it via |*out_addr| and |*out_size|. |
| 85 void FindAddressSpace(base::ProcessHandle process, | 86 void FindAddressSpace(base::ProcessHandle process, |
| 86 char** out_addr, size_t* out_size) { | 87 char** out_addr, size_t* out_size) { |
| 87 *out_addr = NULL; | 88 *out_addr = NULL; |
| 88 *out_size = 0; | 89 *out_size = 0; |
| 89 char* addr = 0; | 90 char* addr = 0; |
| 90 while (true) { | 91 while (true) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 112 if (*i == dir) | 113 if (*i == dir) |
| 113 return true; | 114 return true; |
| 114 } | 115 } |
| 115 return false; | 116 return false; |
| 116 } | 117 } |
| 117 | 118 |
| 118 #endif // _DLL | 119 #endif // _DLL |
| 119 | 120 |
| 120 } // namespace | 121 } // namespace |
| 121 | 122 |
| 122 namespace nacl { | |
| 123 | |
| 124 // Allocates |size| bytes of address space in the given process at a | 123 // Allocates |size| bytes of address space in the given process at a |
| 125 // randomised address. | 124 // randomised address. |
| 126 void* AllocateAddressSpaceASLR(base::ProcessHandle process, size_t size) { | 125 void* AllocateAddressSpaceASLR(base::ProcessHandle process, size_t size) { |
| 127 char* addr; | 126 char* addr; |
| 128 size_t avail_size; | 127 size_t avail_size; |
| 129 FindAddressSpace(process, &addr, &avail_size); | 128 FindAddressSpace(process, &addr, &avail_size); |
| 130 if (avail_size < size) | 129 if (avail_size < size) |
| 131 return NULL; | 130 return NULL; |
| 132 size_t offset = base::RandGenerator(avail_size - size); | 131 size_t offset = base::RandGenerator(avail_size - size); |
| 133 const int kPageSize = 0x10000; | 132 const int kPageSize = 0x10000; |
| 134 void* request_addr = | 133 void* request_addr = |
| 135 reinterpret_cast<void*>(reinterpret_cast<uint64>(addr + offset) | 134 reinterpret_cast<void*>(reinterpret_cast<uint64>(addr + offset) |
| 136 & ~(kPageSize - 1)); | 135 & ~(kPageSize - 1)); |
| 137 return VirtualAllocEx(process, request_addr, size, | 136 return VirtualAllocEx(process, request_addr, size, |
| 138 MEM_RESERVE, PAGE_NOACCESS); | 137 MEM_RESERVE, PAGE_NOACCESS); |
| 139 } | 138 } |
| 140 | 139 |
| 141 } // namespace nacl | 140 namespace { |
| 141 |
| 142 bool RunningOnWOW64() { |
| 143 return (base::win::OSInfo::GetInstance()->wow64_status() == |
| 144 base::win::OSInfo::WOW64_ENABLED); |
| 145 } |
| 146 |
| 147 } // namespace |
| 142 | 148 |
| 143 #endif // defined(OS_WIN) | 149 #endif // defined(OS_WIN) |
| 144 | 150 |
| 145 namespace { | 151 namespace { |
| 146 | 152 |
| 147 #if defined(OS_WIN) | |
| 148 bool RunningOnWOW64() { | |
| 149 return (base::win::OSInfo::GetInstance()->wow64_status() == | |
| 150 base::win::OSInfo::WOW64_ENABLED); | |
| 151 } | |
| 152 #endif | |
| 153 | |
| 154 // NOTE: changes to this class need to be reviewed by the security team. | 153 // NOTE: changes to this class need to be reviewed by the security team. |
| 155 class NaClSandboxedProcessLauncherDelegate | 154 class NaClSandboxedProcessLauncherDelegate |
| 156 : public content::SandboxedProcessLauncherDelegate { | 155 : public content::SandboxedProcessLauncherDelegate { |
| 157 public: | 156 public: |
| 158 NaClSandboxedProcessLauncherDelegate(ChildProcessHost* host) | 157 NaClSandboxedProcessLauncherDelegate(ChildProcessHost* host) |
| 159 #if defined(OS_POSIX) | 158 #if defined(OS_POSIX) |
| 160 : ipc_fd_(host->TakeClientFileDescriptor()) | 159 : ipc_fd_(host->TakeClientFileDescriptor()) |
| 161 #endif | 160 #endif |
| 162 {} | 161 {} |
| 163 | 162 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 nacl::FileDescriptor channel; | 225 nacl::FileDescriptor channel; |
| 227 channel.fd = sourceh; | 226 channel.fd = sourceh; |
| 228 channel.auto_close = close_source; | 227 channel.auto_close = close_source; |
| 229 handles_for_sel_ldr->push_back(channel); | 228 handles_for_sel_ldr->push_back(channel); |
| 230 #endif | 229 #endif |
| 231 return true; | 230 return true; |
| 232 } | 231 } |
| 233 | 232 |
| 234 } // namespace | 233 } // namespace |
| 235 | 234 |
| 236 namespace nacl { | |
| 237 | |
| 238 struct NaClProcessHost::NaClInternal { | |
| 239 NaClHandle socket_for_renderer; | |
| 240 NaClHandle socket_for_sel_ldr; | |
| 241 | |
| 242 NaClInternal() | |
| 243 : socket_for_renderer(NACL_INVALID_HANDLE), | |
| 244 socket_for_sel_ldr(NACL_INVALID_HANDLE) { } | |
| 245 }; | |
| 246 | |
| 247 // ----------------------------------------------------------------------------- | |
| 248 | |
| 249 unsigned NaClProcessHost::keepalive_throttle_interval_milliseconds_ = | 235 unsigned NaClProcessHost::keepalive_throttle_interval_milliseconds_ = |
| 250 ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds; | 236 ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds; |
| 251 | 237 |
| 252 NaClProcessHost::NaClProcessHost(const GURL& manifest_url, | 238 NaClProcessHost::NaClProcessHost(const GURL& manifest_url, |
| 253 base::File nexe_file, | 239 base::File nexe_file, |
| 254 const NaClFileToken& nexe_token, | 240 const NaClFileToken& nexe_token, |
| 255 ppapi::PpapiPermissions permissions, | 241 ppapi::PpapiPermissions permissions, |
| 256 int render_view_id, | 242 int render_view_id, |
| 257 uint32 permission_bits, | 243 uint32 permission_bits, |
| 258 bool uses_irt, | 244 bool uses_irt, |
| 259 bool uses_nonsfi_mode, | 245 bool uses_nonsfi_mode, |
| 260 bool enable_dyncode_syscalls, | 246 bool enable_dyncode_syscalls, |
| 261 bool enable_exception_handling, | 247 bool enable_exception_handling, |
| 262 bool enable_crash_throttling, | 248 bool enable_crash_throttling, |
| 263 bool off_the_record, | 249 bool off_the_record, |
| 264 const base::FilePath& profile_directory) | 250 const base::FilePath& profile_directory) |
| 265 : manifest_url_(manifest_url), | 251 : manifest_url_(manifest_url), |
| 266 nexe_file_(nexe_file.Pass()), | 252 nexe_file_(nexe_file.Pass()), |
| 267 nexe_token_(nexe_token), | 253 nexe_token_(nexe_token), |
| 268 permissions_(permissions), | 254 permissions_(permissions), |
| 269 #if defined(OS_WIN) | 255 #if defined(OS_WIN) |
| 270 process_launched_by_broker_(false), | 256 process_launched_by_broker_(false), |
| 271 #endif | 257 #endif |
| 272 reply_msg_(NULL), | 258 reply_msg_(NULL), |
| 273 #if defined(OS_WIN) | 259 #if defined(OS_WIN) |
| 274 debug_exception_handler_requested_(false), | 260 debug_exception_handler_requested_(false), |
| 275 #endif | 261 #endif |
| 276 internal_(new NaClInternal()), | |
| 277 uses_irt_(uses_irt), | 262 uses_irt_(uses_irt), |
| 278 uses_nonsfi_mode_(uses_nonsfi_mode), | 263 uses_nonsfi_mode_(uses_nonsfi_mode), |
| 279 enable_debug_stub_(false), | 264 enable_debug_stub_(false), |
| 280 enable_dyncode_syscalls_(enable_dyncode_syscalls), | 265 enable_dyncode_syscalls_(enable_dyncode_syscalls), |
| 281 enable_exception_handling_(enable_exception_handling), | 266 enable_exception_handling_(enable_exception_handling), |
| 282 enable_crash_throttling_(enable_crash_throttling), | 267 enable_crash_throttling_(enable_crash_throttling), |
| 283 off_the_record_(off_the_record), | 268 off_the_record_(off_the_record), |
| 284 profile_directory_(profile_directory), | 269 profile_directory_(profile_directory), |
| 285 render_view_id_(render_view_id), | 270 render_view_id_(render_view_id), |
| 286 weak_factory_(this) { | 271 weak_factory_(this) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 306 base::StringPrintf("NaCl process exited with status %i (0x%x)", | 291 base::StringPrintf("NaCl process exited with status %i (0x%x)", |
| 307 exit_code, exit_code); | 292 exit_code, exit_code); |
| 308 if (exit_code == 0) { | 293 if (exit_code == 0) { |
| 309 VLOG(1) << message; | 294 VLOG(1) << message; |
| 310 } else { | 295 } else { |
| 311 LOG(ERROR) << message; | 296 LOG(ERROR) << message; |
| 312 } | 297 } |
| 313 NaClBrowser::GetInstance()->OnProcessEnd(process_->GetData().id); | 298 NaClBrowser::GetInstance()->OnProcessEnd(process_->GetData().id); |
| 314 } | 299 } |
| 315 | 300 |
| 316 if (internal_->socket_for_renderer != NACL_INVALID_HANDLE) { | |
| 317 if (NaClClose(internal_->socket_for_renderer) != 0) { | |
| 318 NOTREACHED() << "NaClClose() failed"; | |
| 319 } | |
| 320 } | |
| 321 | |
| 322 if (internal_->socket_for_sel_ldr != NACL_INVALID_HANDLE) { | |
| 323 if (NaClClose(internal_->socket_for_sel_ldr) != 0) { | |
| 324 NOTREACHED() << "NaClClose() failed"; | |
| 325 } | |
| 326 } | |
| 327 | |
| 328 if (reply_msg_) { | 301 if (reply_msg_) { |
| 329 // The process failed to launch for some reason. | 302 // The process failed to launch for some reason. |
| 330 // Don't keep the renderer hanging. | 303 // Don't keep the renderer hanging. |
| 331 reply_msg_->set_reply_error(); | 304 reply_msg_->set_reply_error(); |
| 332 nacl_host_message_filter_->Send(reply_msg_); | 305 nacl_host_message_filter_->Send(reply_msg_); |
| 333 } | 306 } |
| 334 #if defined(OS_WIN) | 307 #if defined(OS_WIN) |
| 335 if (process_launched_by_broker_) { | 308 if (process_launched_by_broker_) { |
| 336 NaClBrokerService::GetInstance()->OnLoaderDied(); | 309 NaClBrokerService::GetInstance()->OnLoaderDied(); |
| 337 } | 310 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // This means the sandboxed renderer cannot send handles to the | 434 // This means the sandboxed renderer cannot send handles to the |
| 462 // browser process. | 435 // browser process. |
| 463 | 436 |
| 464 NaClHandle pair[2]; | 437 NaClHandle pair[2]; |
| 465 // Create a connected socket | 438 // Create a connected socket |
| 466 if (NaClSocketPair(pair) == -1) { | 439 if (NaClSocketPair(pair) == -1) { |
| 467 SendErrorToRenderer("NaClSocketPair() failed"); | 440 SendErrorToRenderer("NaClSocketPair() failed"); |
| 468 delete this; | 441 delete this; |
| 469 return; | 442 return; |
| 470 } | 443 } |
| 471 internal_->socket_for_renderer = pair[0]; | 444 socket_for_renderer_ = base::File(pair[0]); |
| 472 internal_->socket_for_sel_ldr = pair[1]; | 445 socket_for_sel_ldr_ = base::File(pair[1]); |
| 473 SetCloseOnExec(pair[0]); | 446 SetCloseOnExec(pair[0]); |
| 474 SetCloseOnExec(pair[1]); | 447 SetCloseOnExec(pair[1]); |
| 475 } | 448 } |
| 476 | 449 |
| 477 // Create a shared memory region that the renderer and plugin share for | 450 // Create a shared memory region that the renderer and plugin share for |
| 478 // reporting crash information. | 451 // reporting crash information. |
| 479 crash_info_shmem_.CreateAnonymous(kNaClCrashInfoShmemSize); | 452 crash_info_shmem_.CreateAnonymous(kNaClCrashInfoShmemSize); |
| 480 | 453 |
| 481 // Launch the process | 454 // Launch the process |
| 482 if (!LaunchSelLdr()) { | 455 if (!LaunchSelLdr()) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 return false; | 687 return false; |
| 715 } | 688 } |
| 716 } | 689 } |
| 717 #endif | 690 #endif |
| 718 | 691 |
| 719 FileDescriptor imc_handle_for_renderer; | 692 FileDescriptor imc_handle_for_renderer; |
| 720 #if defined(OS_WIN) | 693 #if defined(OS_WIN) |
| 721 // Copy the handle into the renderer process. | 694 // Copy the handle into the renderer process. |
| 722 HANDLE handle_in_renderer; | 695 HANDLE handle_in_renderer; |
| 723 if (!DuplicateHandle(base::GetCurrentProcessHandle(), | 696 if (!DuplicateHandle(base::GetCurrentProcessHandle(), |
| 724 reinterpret_cast<HANDLE>( | 697 socket_for_renderer_.TakePlatformFile(), |
| 725 internal_->socket_for_renderer), | |
| 726 nacl_host_message_filter_->PeerHandle(), | 698 nacl_host_message_filter_->PeerHandle(), |
| 727 &handle_in_renderer, | 699 &handle_in_renderer, |
| 728 0, // Unused given DUPLICATE_SAME_ACCESS. | 700 0, // Unused given DUPLICATE_SAME_ACCESS. |
| 729 FALSE, | 701 FALSE, |
| 730 DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { | 702 DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { |
| 731 SendErrorToRenderer("DuplicateHandle() failed"); | 703 SendErrorToRenderer("DuplicateHandle() failed"); |
| 732 return false; | 704 return false; |
| 733 } | 705 } |
| 734 imc_handle_for_renderer = reinterpret_cast<FileDescriptor>( | 706 imc_handle_for_renderer = reinterpret_cast<FileDescriptor>( |
| 735 handle_in_renderer); | 707 handle_in_renderer); |
| 736 #else | 708 #else |
| 737 // No need to dup the imc_handle - we don't pass it anywhere else so | 709 // No need to dup the imc_handle - we don't pass it anywhere else so |
| 738 // it cannot be closed. | 710 // it cannot be closed. |
| 739 FileDescriptor imc_handle; | 711 FileDescriptor imc_handle; |
| 740 imc_handle.fd = internal_->socket_for_renderer; | 712 imc_handle.fd = socket_for_renderer_.TakePlatformFile(); |
| 741 imc_handle.auto_close = true; | 713 imc_handle.auto_close = true; |
| 742 imc_handle_for_renderer = imc_handle; | 714 imc_handle_for_renderer = imc_handle; |
| 743 #endif | 715 #endif |
| 744 | 716 |
| 745 const ChildProcessData& data = process_->GetData(); | 717 const ChildProcessData& data = process_->GetData(); |
| 746 base::SharedMemoryHandle crash_info_shmem_renderer_handle; | 718 base::SharedMemoryHandle crash_info_shmem_renderer_handle; |
| 747 if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(), | 719 if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(), |
| 748 &crash_info_shmem_renderer_handle)) { | 720 &crash_info_shmem_renderer_handle)) { |
| 749 SendErrorToRenderer("ShareToProcess() failed"); | 721 SendErrorToRenderer("ShareToProcess() failed"); |
| 750 return false; | 722 return false; |
| 751 } | 723 } |
| 752 | 724 |
| 753 SendMessageToRenderer( | 725 SendMessageToRenderer( |
| 754 NaClLaunchResult(imc_handle_for_renderer, | 726 NaClLaunchResult(imc_handle_for_renderer, |
| 755 ppapi_channel_handle, | 727 ppapi_channel_handle, |
| 756 trusted_channel_handle, | 728 trusted_channel_handle, |
| 757 manifest_service_channel_handle, | 729 manifest_service_channel_handle, |
| 758 base::GetProcId(data.handle), | 730 base::GetProcId(data.handle), |
| 759 data.id, | 731 data.id, |
| 760 crash_info_shmem_renderer_handle), | 732 crash_info_shmem_renderer_handle), |
| 761 std::string() /* error_message */); | 733 std::string() /* error_message */); |
| 762 internal_->socket_for_renderer = NACL_INVALID_HANDLE; | |
| 763 | 734 |
| 764 // Now that the crash information shmem handles have been shared with the | 735 // Now that the crash information shmem handles have been shared with the |
| 765 // plugin and the renderer, the browser can close its handle. | 736 // plugin and the renderer, the browser can close its handle. |
| 766 crash_info_shmem_.Close(); | 737 crash_info_shmem_.Close(); |
| 767 return true; | 738 return true; |
| 768 } | 739 } |
| 769 | 740 |
| 770 void NaClProcessHost::SendErrorToRenderer(const std::string& error_message) { | 741 void NaClProcessHost::SendErrorToRenderer(const std::string& error_message) { |
| 771 LOG(ERROR) << "NaCl process launch failed: " << error_message; | 742 LOG(ERROR) << "NaCl process launch failed: " << error_message; |
| 772 SendMessageToRenderer(NaClLaunchResult(), error_message); | 743 SendMessageToRenderer(NaClLaunchResult(), error_message); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 | 808 |
| 838 NaClStartParams params; | 809 NaClStartParams params; |
| 839 | 810 |
| 840 // Enable PPAPI proxy channel creation only for renderer processes. | 811 // Enable PPAPI proxy channel creation only for renderer processes. |
| 841 params.enable_ipc_proxy = enable_ppapi_proxy(); | 812 params.enable_ipc_proxy = enable_ppapi_proxy(); |
| 842 if (uses_nonsfi_mode_) { | 813 if (uses_nonsfi_mode_) { |
| 843 // Currently, non-SFI mode is supported only on Linux. | 814 // Currently, non-SFI mode is supported only on Linux. |
| 844 #if defined(OS_LINUX) | 815 #if defined(OS_LINUX) |
| 845 // In non-SFI mode, we do not use SRPC. Make sure that the socketpair is | 816 // In non-SFI mode, we do not use SRPC. Make sure that the socketpair is |
| 846 // not created. | 817 // not created. |
| 847 DCHECK_EQ(internal_->socket_for_sel_ldr, NACL_INVALID_HANDLE); | 818 DCHECK(!socket_for_sel_ldr_.IsValid()); |
| 848 #endif | 819 #endif |
| 849 } else { | 820 } else { |
| 850 params.validation_cache_enabled = nacl_browser->ValidationCacheIsEnabled(); | 821 params.validation_cache_enabled = nacl_browser->ValidationCacheIsEnabled(); |
| 851 params.validation_cache_key = nacl_browser->GetValidationCacheKey(); | 822 params.validation_cache_key = nacl_browser->GetValidationCacheKey(); |
| 852 params.version = NaClBrowser::GetDelegate()->GetVersionString(); | 823 params.version = NaClBrowser::GetDelegate()->GetVersionString(); |
| 853 params.enable_exception_handling = enable_exception_handling_; | 824 params.enable_exception_handling = enable_exception_handling_; |
| 854 params.enable_debug_stub = enable_debug_stub_ && | 825 params.enable_debug_stub = enable_debug_stub_ && |
| 855 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_); | 826 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_); |
| 856 params.uses_irt = uses_irt_; | 827 params.uses_irt = uses_irt_; |
| 857 params.enable_dyncode_syscalls = enable_dyncode_syscalls_; | 828 params.enable_dyncode_syscalls = enable_dyncode_syscalls_; |
| 858 | 829 |
| 859 // TODO(teravest): Resolve the file tokens right now instead of making the | 830 // TODO(teravest): Resolve the file tokens right now instead of making the |
| 860 // loader send IPC to resolve them later. | 831 // loader send IPC to resolve them later. |
| 861 params.nexe_token_lo = nexe_token_.lo; | 832 params.nexe_token_lo = nexe_token_.lo; |
| 862 params.nexe_token_hi = nexe_token_.hi; | 833 params.nexe_token_hi = nexe_token_.hi; |
| 863 | 834 |
| 864 const ChildProcessData& data = process_->GetData(); | 835 const ChildProcessData& data = process_->GetData(); |
| 865 if (!ShareHandleToSelLdr(data.handle, | 836 if (!ShareHandleToSelLdr(data.handle, |
| 866 internal_->socket_for_sel_ldr, true, | 837 socket_for_sel_ldr_.TakePlatformFile(), |
| 838 true, |
| 867 ¶ms.handles)) { | 839 ¶ms.handles)) { |
| 868 return false; | 840 return false; |
| 869 } | 841 } |
| 870 | 842 |
| 871 if (params.uses_irt) { | 843 if (params.uses_irt) { |
| 872 const base::File& irt_file = nacl_browser->IrtFile(); | 844 const base::File& irt_file = nacl_browser->IrtFile(); |
| 873 CHECK(irt_file.IsValid()); | 845 CHECK(irt_file.IsValid()); |
| 874 // Send over the IRT file handle. We don't close our own copy! | 846 // Send over the IRT file handle. We don't close our own copy! |
| 875 if (!ShareHandleToSelLdr(data.handle, irt_file.GetPlatformFile(), false, | 847 if (!ShareHandleToSelLdr(data.handle, irt_file.GetPlatformFile(), false, |
| 876 ¶ms.handles)) { | 848 ¶ms.handles)) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 905 if (params.enable_debug_stub) { | 877 if (params.enable_debug_stub) { |
| 906 net::SocketDescriptor server_bound_socket = GetDebugStubSocketHandle(); | 878 net::SocketDescriptor server_bound_socket = GetDebugStubSocketHandle(); |
| 907 if (server_bound_socket != net::kInvalidSocket) { | 879 if (server_bound_socket != net::kInvalidSocket) { |
| 908 params.debug_stub_server_bound_socket = | 880 params.debug_stub_server_bound_socket = |
| 909 FileDescriptor(server_bound_socket, true); | 881 FileDescriptor(server_bound_socket, true); |
| 910 } | 882 } |
| 911 } | 883 } |
| 912 #endif | 884 #endif |
| 913 } | 885 } |
| 914 | 886 |
| 915 if (!uses_nonsfi_mode_) { | |
| 916 internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE; | |
| 917 } | |
| 918 | |
| 919 params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(), | 887 params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(), |
| 920 process_->GetData().handle); | 888 process_->GetData().handle); |
| 921 if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle, | 889 if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle, |
| 922 ¶ms.crash_info_shmem_handle)) { | 890 ¶ms.crash_info_shmem_handle)) { |
| 923 DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer"; | 891 DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer"; |
| 924 return false; | 892 return false; |
| 925 } | 893 } |
| 926 | 894 |
| 927 process_->Send(new NaClProcessMsg_Start(params)); | 895 process_->Send(new NaClProcessMsg_Start(params)); |
| 928 return true; | 896 return true; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 process_handle.Take(), info, | 1195 process_handle.Take(), info, |
| 1228 base::MessageLoopProxy::current(), | 1196 base::MessageLoopProxy::current(), |
| 1229 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1197 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1230 weak_factory_.GetWeakPtr())); | 1198 weak_factory_.GetWeakPtr())); |
| 1231 return true; | 1199 return true; |
| 1232 } | 1200 } |
| 1233 } | 1201 } |
| 1234 #endif | 1202 #endif |
| 1235 | 1203 |
| 1236 } // namespace nacl | 1204 } // namespace nacl |
| OLD | NEW |