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

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

Issue 299683004: Rewrite all BPF policies to use DSL API Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Overhaul of DSL and implementation Created 6 years, 7 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
« no previous file with comments | « no previous file | components/nacl/loader/nonsfi/nonsfi_sandbox.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_ 5 #ifndef COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
6 #define COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_ 6 #define COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h" 9 #include "sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h"
10 10
11 namespace nacl { 11 namespace nacl {
12 namespace nonsfi { 12 namespace nonsfi {
13 13
14 // The seccomp sandbox policy for NaCl non-SFI mode. Note that this 14 // The seccomp sandbox policy for NaCl non-SFI mode. Note that this
15 // policy must be as strong as possible, as non-SFI mode heavily 15 // policy must be as strong as possible, as non-SFI mode heavily
16 // depends on seccomp sandbox. 16 // depends on seccomp sandbox.
17 class NaClNonSfiBPFSandboxPolicy : public sandbox::SandboxBPFPolicy { 17 class NaClNonSfiBPFSandboxPolicy
18 : public sandbox::bpf_dsl::SandboxBPFPolicyDSL {
18 public: 19 public:
19 explicit NaClNonSfiBPFSandboxPolicy() {} 20 explicit NaClNonSfiBPFSandboxPolicy() {}
20 virtual ~NaClNonSfiBPFSandboxPolicy() {} 21 virtual ~NaClNonSfiBPFSandboxPolicy() {}
21 22
22 virtual sandbox::ErrorCode EvaluateSyscall(sandbox::SandboxBPF* sb, 23 virtual sandbox::bpf_dsl::ResultExpr EvaluateSyscall(
23 int sysno) const OVERRIDE; 24 int sysno) const OVERRIDE;
24 25
25 private: 26 private:
26 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy); 27 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy);
27 }; 28 };
28 29
29 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on 30 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on
30 // failure. 31 // failure.
31 bool InitializeBPFSandbox(); 32 bool InitializeBPFSandbox();
32 33
33 } // namespace nonsfi 34 } // namespace nonsfi
34 } // namespace nacl 35 } // namespace nacl
35 36
36 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_ 37 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
OLDNEW
« no previous file with comments | « no previous file | components/nacl/loader/nonsfi/nonsfi_sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698