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

Side by Side Diff: components/nacl/loader/nacl_listener.cc

Issue 196793023: Add seccomp sandbox for non-SFI NaCl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void NaClListener::OnStart(const nacl::NaClStartParams& params) { 261 void NaClListener::OnStart(const nacl::NaClStartParams& params) {
262 #if defined(OS_LINUX) || defined(OS_MACOSX) 262 #if defined(OS_LINUX) || defined(OS_MACOSX)
263 int urandom_fd = dup(base::GetUrandomFD()); 263 int urandom_fd = dup(base::GetUrandomFD());
264 if (urandom_fd < 0) { 264 if (urandom_fd < 0) {
265 LOG(ERROR) << "Failed to dup() the urandom FD"; 265 LOG(ERROR) << "Failed to dup() the urandom FD";
266 return; 266 return;
267 } 267 }
268 NaClChromeMainSetUrandomFd(urandom_fd); 268 NaClChromeMainSetUrandomFd(urandom_fd);
269 #endif 269 #endif
270 270
271 NaClChromeMainInit(); 271 if (params.uses_nonsfi_mode)
272 NaClChromeMainInitForNonSfi();
Mark Seaborn 2014/03/28 01:38:25 AFAICT, this function isn't defined, so this chang
hamaji 2014/03/28 12:06:10 Sorry, I forgot to publish this change (https://co
273 else
274 NaClChromeMainInit();
272 struct NaClChromeMainArgs *args = NaClChromeMainArgsCreate(); 275 struct NaClChromeMainArgs *args = NaClChromeMainArgsCreate();
273 if (args == NULL) { 276 if (args == NULL) {
274 LOG(ERROR) << "NaClChromeMainArgsCreate() failed"; 277 LOG(ERROR) << "NaClChromeMainArgsCreate() failed";
275 return; 278 return;
276 } 279 }
277 280
278 struct NaClApp *nap = NaClAppCreate(); 281 struct NaClApp *nap = NaClAppCreate();
279 if (nap == NULL) { 282 if (nap == NULL) {
280 LOG(ERROR) << "NaClAppCreate() failed"; 283 LOG(ERROR) << "NaClAppCreate() failed";
281 return; 284 return;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 441
439 #if defined(OS_LINUX) 442 #if defined(OS_LINUX)
440 if (params.uses_nonsfi_mode) { 443 if (params.uses_nonsfi_mode) {
441 nacl::nonsfi::MainStart(args->imc_bootstrap_handle); 444 nacl::nonsfi::MainStart(args->imc_bootstrap_handle);
442 return; 445 return;
443 } 446 }
444 #endif 447 #endif
445 NaClChromeMainStartApp(nap, args); 448 NaClChromeMainStartApp(nap, args);
446 NOTREACHED(); 449 NOTREACHED();
447 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698