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

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

Issue 1295513003: Non-SFI mode: Sandbox support for NaCl async-signals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback Created 5 years, 4 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 | « 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 "base/files/scoped_file.h" 9 #include "base/files/scoped_file.h"
10 #include "sandbox/linux/bpf_dsl/bpf_dsl_forward.h" 10 #include "sandbox/linux/bpf_dsl/bpf_dsl_forward.h"
11 #include "sandbox/linux/bpf_dsl/policy.h" 11 #include "sandbox/linux/bpf_dsl/policy.h"
12 12
13 namespace nacl { 13 namespace nacl {
14 namespace nonsfi { 14 namespace nonsfi {
15 15
16 // The seccomp sandbox policy for NaCl non-SFI mode. Note that this 16 // The seccomp sandbox policy for NaCl non-SFI mode. Note that this
17 // policy must be as strong as possible, as non-SFI mode heavily 17 // policy must be as strong as possible, as non-SFI mode heavily
18 // depends on seccomp sandbox. 18 // depends on seccomp sandbox.
19 class NaClNonSfiBPFSandboxPolicy : public sandbox::bpf_dsl::Policy { 19 class NaClNonSfiBPFSandboxPolicy : public sandbox::bpf_dsl::Policy {
20 public: 20 public:
21 explicit NaClNonSfiBPFSandboxPolicy() {} 21 explicit NaClNonSfiBPFSandboxPolicy();
22 ~NaClNonSfiBPFSandboxPolicy() override {} 22 ~NaClNonSfiBPFSandboxPolicy() override;
23 23
24 sandbox::bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override; 24 sandbox::bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override;
25 sandbox::bpf_dsl::ResultExpr InvalidSyscall() const override; 25 sandbox::bpf_dsl::ResultExpr InvalidSyscall() const override;
26 26
27 private: 27 private:
28 // The PID that the policy applies to (should be equal to the current pid).
29 pid_t policy_pid_;
jln (very slow on Chromium) 2015/08/17 23:08:35 const
Luis Héctor Chávez 2015/08/17 23:14:59 Done.
30
28 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy); 31 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy);
29 }; 32 };
30 33
31 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on 34 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on
32 // failure. 35 // failure.
33 bool InitializeBPFSandbox(base::ScopedFD proc_fd); 36 bool InitializeBPFSandbox(base::ScopedFD proc_fd);
34 37
35 } // namespace nonsfi 38 } // namespace nonsfi
36 } // namespace nacl 39 } // namespace nacl
37 40
38 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_ 41 #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