Index: content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
diff --git a/content/common/sandbox_linux/bpf_renderer_policy_linux.cc b/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
index 267977866946bde9f14e1d9c9022d8052f52454c..d8e13dc950156cdc89195baaddd4653f77693988 100644 |
--- a/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
+++ b/content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
@@ -9,11 +9,13 @@ |
#include "base/basictypes.h" |
#include "build/build_config.h" |
#include "content/common/sandbox_linux/sandbox_linux.h" |
+#include "sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h" |
#include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" |
#include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" |
#include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h" |
#include "sandbox/linux/services/linux_syscalls.h" |
+using namespace sandbox::bpf_dsl; |
using sandbox::SyscallSets; |
namespace content { |
@@ -21,13 +23,12 @@ namespace content { |
RendererProcessPolicy::RendererProcessPolicy() {} |
RendererProcessPolicy::~RendererProcessPolicy() {} |
-ErrorCode RendererProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox, |
- int sysno) const { |
+ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const { |
switch (sysno) { |
case __NR_ioctl: |
- return sandbox::RestrictIoctl(sandbox); |
+ return sandbox::RestrictIoctl(); |
case __NR_prctl: |
- return sandbox::RestrictPrctl(sandbox); |
+ return sandbox::RestrictPrctl(); |
// Allow the system calls below. |
// The baseline policy allows __NR_clock_gettime. Allow |
// clock_getres() for V8. crbug.com/329053. |
@@ -54,12 +55,12 @@ ErrorCode RendererProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox, |
case __NR_sysinfo: |
case __NR_times: |
case __NR_uname: |
- return ErrorCode(ErrorCode::ERR_ALLOWED); |
+ return Allow(); |
case __NR_prlimit64: |
- return ErrorCode(EPERM); // See crbug.com/160157. |
+ return Error(EPERM); // See crbug.com/160157. |
default: |
// Default on the content baseline policy. |
- return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno); |
+ return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
} |
} |