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

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

Issue 196793023: Add seccomp sandbox for non-SFI NaCl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
6 #define COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
7
8 #include "base/basictypes.h"
9 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h"
10
11 namespace nacl {
12 namespace nonsfi {
13
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
16 // depends on seccomp sandbox.
17 class NaClNonSfiBPFSandboxPolicy : public sandbox::SandboxBPFPolicy {
18 public:
19 explicit NaClNonSfiBPFSandboxPolicy() {
20 }
21 virtual ~NaClNonSfiBPFSandboxPolicy() {}
22
23 virtual sandbox::ErrorCode EvaluateSyscall(sandbox::SandboxBPF* sb,
24 int sysno) const OVERRIDE;
25
26 static sandbox::ErrorCode EvaluateSyscallImpl(sandbox::SandboxBPF* sb,
27 int sysno, void*);
28
29 private:
30 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy);
31 };
32
33 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on
34 // failure.
35 bool InitializeBPFSandbox();
hamaji 2014/04/11 01:25:58 I changed the return value from void to bool, as t
36
37 } // namespace nonsfi
38 } // namespace nacl
39
40 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698