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

Side by Side Diff: components/nacl/browser/nacl_process_host.cc

Issue 1312273002: NaCl: Re-enable ASLR for nacl-loader processes on Mac OS X (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 589
590 bool NaClProcessHost::LaunchSelLdr() { 590 bool NaClProcessHost::LaunchSelLdr() {
591 std::string channel_id = process_->GetHost()->CreateChannel(); 591 std::string channel_id = process_->GetHost()->CreateChannel();
592 if (channel_id.empty()) { 592 if (channel_id.empty()) {
593 SendErrorToRenderer("CreateChannel() failed"); 593 SendErrorToRenderer("CreateChannel() failed");
594 return false; 594 return false;
595 } 595 }
596 596
597 // Build command line for nacl. 597 // Build command line for nacl.
598 598
599 #if defined(OS_MACOSX) 599 #if defined(OS_LINUX)
600 // The Native Client process needs to be able to allocate a 1GB contiguous
601 // region to use as the client environment's virtual address space. ASLR
602 // (PIE) interferes with this by making it possible that no gap large enough
603 // to accomodate this request will exist in the child process' address
604 // space. Disable PIE for NaCl processes. See http://crbug.com/90221 and
605 // http://code.google.com/p/nativeclient/issues/detail?id=2043.
606 int flags = ChildProcessHost::CHILD_NO_PIE;
607 #elif defined(OS_LINUX)
608 int flags = ChildProcessHost::CHILD_ALLOW_SELF; 600 int flags = ChildProcessHost::CHILD_ALLOW_SELF;
609 #else 601 #else
610 int flags = ChildProcessHost::CHILD_NORMAL; 602 int flags = ChildProcessHost::CHILD_NORMAL;
611 #endif 603 #endif
612 604
613 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); 605 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags);
614 if (exe_path.empty()) 606 if (exe_path.empty())
615 return false; 607 return false;
616 608
617 #if defined(OS_WIN) 609 #if defined(OS_WIN)
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 NaClStartDebugExceptionHandlerThread( 1377 NaClStartDebugExceptionHandlerThread(
1386 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), 1378 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(),
1387 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 1379 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
1388 weak_factory_.GetWeakPtr())); 1380 weak_factory_.GetWeakPtr()));
1389 return true; 1381 return true;
1390 } 1382 }
1391 } 1383 }
1392 #endif 1384 #endif
1393 1385
1394 } // namespace nacl 1386 } // namespace nacl
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698