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

Side by Side Diff: components/nacl/loader/nonsfi/nonsfi_sandbox.cc

Issue 938223004: Linux sandbox: better APIs with /proc/ arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix invalid proc_fd_ usage. Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/nonsfi/nonsfi_sandbox.h" 5 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/futex.h> 9 #include <linux/futex.h>
10 #include <linux/net.h> 10 #include <linux/net.h>
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 if (IsGracefullyDenied(sysno)) 293 if (IsGracefullyDenied(sysno))
294 return Error(EPERM); 294 return Error(EPERM);
295 return CrashSIGSYS(); 295 return CrashSIGSYS();
296 } 296 }
297 } 297 }
298 298
299 ResultExpr NaClNonSfiBPFSandboxPolicy::InvalidSyscall() const { 299 ResultExpr NaClNonSfiBPFSandboxPolicy::InvalidSyscall() const {
300 return CrashSIGSYS(); 300 return CrashSIGSYS();
301 } 301 }
302 302
303 bool InitializeBPFSandbox(base::ScopedFD proc_task_fd) { 303 bool InitializeBPFSandbox(base::ScopedFD proc_fd) {
304 bool sandbox_is_initialized = content::InitializeSandbox( 304 bool sandbox_is_initialized = content::InitializeSandbox(
305 scoped_ptr<sandbox::bpf_dsl::Policy>( 305 scoped_ptr<sandbox::bpf_dsl::Policy>(
306 new nacl::nonsfi::NaClNonSfiBPFSandboxPolicy()), 306 new nacl::nonsfi::NaClNonSfiBPFSandboxPolicy()),
307 proc_task_fd.Pass()); 307 proc_fd.Pass());
308 if (!sandbox_is_initialized) 308 if (!sandbox_is_initialized)
309 return false; 309 return false;
310 RunSandboxSanityChecks(); 310 RunSandboxSanityChecks();
311 return true; 311 return true;
312 } 312 }
313 313
314 } // namespace nonsfi 314 } // namespace nonsfi
315 } // namespace nacl 315 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_sandbox.h ('k') | components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698