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
3 // found in the LICENSE file.
5 #include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
9 #include "base/logging.h"
10 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h"
12 using sandbox::bpf_dsl::ResultExpr
;
18 // The errno used for denied file system access system calls, such as open(2).
19 static const int kFSDeniedErrno
= EPERM
;
23 SandboxBPFBasePolicy::SandboxBPFBasePolicy()
24 : baseline_policy_(new sandbox::BaselinePolicy(kFSDeniedErrno
)) {}
25 SandboxBPFBasePolicy::~SandboxBPFBasePolicy() {}
27 ResultExpr
SandboxBPFBasePolicy::EvaluateSyscall(int system_call_number
) const {
28 DCHECK(baseline_policy_
);
29 return baseline_policy_
->EvaluateSyscall(system_call_number
);
32 ResultExpr
SandboxBPFBasePolicy::InvalidSyscall() const {
33 DCHECK(baseline_policy_
);
34 return baseline_policy_
->InvalidSyscall();
37 bool SandboxBPFBasePolicy::PreSandboxHook() {
41 int SandboxBPFBasePolicy::GetFSDeniedErrno() {
42 return kFSDeniedErrno
;
45 } // namespace content.