Chromium Code Reviews| Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
| diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
| index 8ea2600a7ed9a20695b921f4a652bb947f50917b..b26089ce641928aadbdd59936481ea92975dcadf 100644 |
| --- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
| +++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
| @@ -28,6 +28,7 @@ |
| #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" |
| #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
| #include "sandbox/linux/services/broker_process.h" |
| +#include "sandbox/linux/services/kernel_to_errno.h" |
| #include "sandbox/linux/services/linux_syscalls.h" |
| using sandbox::BrokerProcess; |
| @@ -96,11 +97,11 @@ intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args, |
| broker_process->Open(reinterpret_cast<const char*>(args.args[1]), |
| static_cast<int>(args.args[2])); |
| } else { |
| - return -EPERM; |
| + return KernelRetToErrno(EPERM); |
|
jln (very slow on Chromium)
2014/05/16 19:30:17
This function is misnamed in this context. EPERM i
nedeljko
2014/05/22 17:38:55
Done.
|
| } |
| default: |
| RAW_CHECK(false); |
| - return -ENOSYS; |
| + return KernelRetToErrno(ENOSYS); |
| } |
| } |
| @@ -167,7 +168,7 @@ ErrorCode GpuProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox, |
| int sysno) const { |
| switch (sysno) { |
| case __NR_ioctl: |
| -#if defined(__i386__) || defined(__x86_64__) |
| +#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) |
| // The Nvidia driver uses flags not in the baseline policy |
| // (MAP_LOCKED | MAP_EXECUTABLE | MAP_32BIT) |
| case __NR_mmap: |