| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <asm/unistd.h> | 5 #include <asm/unistd.h> |
| 6 #include <dlfcn.h> | 6 #include <dlfcn.h> |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/audit.h> | 9 #include <linux/audit.h> |
| 10 #include <linux/filter.h> | 10 #include <linux/filter.h> |
| (...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 CHECK(started_sandbox); | 1941 CHECK(started_sandbox); |
| 1942 return true; | 1942 return true; |
| 1943 } | 1943 } |
| 1944 #endif | 1944 #endif |
| 1945 return false; | 1945 return false; |
| 1946 } | 1946 } |
| 1947 | 1947 |
| 1948 bool SandboxSeccompBpf::StartSandboxWithExternalPolicy( | 1948 bool SandboxSeccompBpf::StartSandboxWithExternalPolicy( |
| 1949 playground2::BpfSandboxPolicy policy) { | 1949 playground2::BpfSandboxPolicy policy) { |
| 1950 #if defined(SECCOMP_BPF_SANDBOX) | 1950 #if defined(SECCOMP_BPF_SANDBOX) |
| 1951 if (IsSeccompBpfDesired()) { | 1951 if (IsSeccompBpfDesired() && SupportsSandbox()) { |
| 1952 CHECK(policy); | 1952 CHECK(policy); |
| 1953 StartSandboxWithPolicy(policy, NULL); | 1953 StartSandboxWithPolicy(policy, NULL); |
| 1954 return true; | 1954 return true; |
| 1955 } | 1955 } |
| 1956 #endif // defined(SECCOMP_BPF_SANDBOX) | 1956 #endif // defined(SECCOMP_BPF_SANDBOX) |
| 1957 return false; | 1957 return false; |
| 1958 } | 1958 } |
| 1959 | 1959 |
| 1960 #if defined(SECCOMP_BPF_SANDBOX) | 1960 #if defined(SECCOMP_BPF_SANDBOX) |
| 1961 playground2::BpfSandboxPolicyCallback SandboxSeccompBpf::GetBaselinePolicy() { | 1961 playground2::BpfSandboxPolicyCallback SandboxSeccompBpf::GetBaselinePolicy() { |
| 1962 return base::Bind(&BaselinePolicyWithAux); | 1962 return base::Bind(&BaselinePolicyWithAux); |
| 1963 } | 1963 } |
| 1964 #endif // defined(SECCOMP_BPF_SANDBOX) | 1964 #endif // defined(SECCOMP_BPF_SANDBOX) |
| 1965 | 1965 |
| 1966 } // namespace content | 1966 } // namespace content |
| OLD | NEW |