| Index: content/common/sandbox_init_linux.cc
|
| diff --git a/content/common/sandbox_init_linux.cc b/content/common/sandbox_init_linux.cc
|
| index a67a784232aa70bcd6c856baf2546384bbab83da..e8ac8a66564749d8e535a132a1ba171bd17dfa6a 100644
|
| --- a/content/common/sandbox_init_linux.cc
|
| +++ b/content/common/sandbox_init_linux.cc
|
| @@ -216,7 +216,7 @@ intptr_t GpuOpenSIGSYS_Handler(const struct arch_seccomp_data& args,
|
|
|
| #if defined(__x86_64__)
|
| // x86_64 only because it references system calls that are multiplexed on IA32.
|
| -playground2::Sandbox::ErrorCode GpuProcessPolicy_x86_64(int sysno) {
|
| +playground2::ErrorCode GpuProcessPolicy_x86_64(int sysno) {
|
| switch(sysno) {
|
| case __NR_read:
|
| case __NR_ioctl:
|
| @@ -264,7 +264,7 @@ playground2::Sandbox::ErrorCode GpuProcessPolicy_x86_64(int sysno) {
|
| case __NR_getppid: // ATI binary driver.
|
| case __NR_shutdown: // Virtual driver.
|
| case __NR_rt_sigaction: // Breakpad signal handler.
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| case __NR_socket:
|
| return EACCES; // Nvidia binary driver.
|
| case __NR_fchmod:
|
| @@ -273,11 +273,11 @@ playground2::Sandbox::ErrorCode GpuProcessPolicy_x86_64(int sysno) {
|
| // Hook open() in the GPU process to allow opening /etc/drirc,
|
| // needed by Mesa.
|
| // The hook needs dup(), lseek(), and close() to be allowed.
|
| - return playground2::Sandbox::ErrorCode(GpuOpenSIGSYS_Handler, NULL);
|
| + return playground2::Sandbox::Trap(GpuOpenSIGSYS_Handler, NULL);
|
| default:
|
| if (IsGettimeSyscall(sysno) ||
|
| IsKillSyscall(sysno)) { // GPU watchdog.
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| }
|
| // Generally, filename-based syscalls will fail with ENOENT to behave
|
| // similarly to a possible future setuid sandbox.
|
| @@ -285,12 +285,12 @@ playground2::Sandbox::ErrorCode GpuProcessPolicy_x86_64(int sysno) {
|
| return ENOENT;
|
| }
|
| // In any other case crash the program with our SIGSYS handler
|
| - return playground2::Sandbox::ErrorCode(CrashSIGSYS_Handler, NULL);
|
| + return playground2::Sandbox::Trap(CrashSIGSYS_Handler, NULL);
|
| }
|
| }
|
|
|
| // x86_64 only because it references system calls that are multiplexed on IA32.
|
| -playground2::Sandbox::ErrorCode FlashProcessPolicy_x86_64(int sysno) {
|
| +playground2::ErrorCode FlashProcessPolicy_x86_64(int sysno) {
|
| switch (sysno) {
|
| case __NR_futex:
|
| case __NR_write:
|
| @@ -336,7 +336,7 @@ playground2::Sandbox::ErrorCode FlashProcessPolicy_x86_64(int sysno) {
|
| case __NR_shmctl:
|
| case __NR_shmat:
|
| case __NR_shmdt:
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| case __NR_ioctl:
|
| return ENOTTY; // Flash Access.
|
| case __NR_socket:
|
| @@ -345,18 +345,18 @@ playground2::Sandbox::ErrorCode FlashProcessPolicy_x86_64(int sysno) {
|
| default:
|
| if (IsGettimeSyscall(sysno) ||
|
| IsKillSyscall(sysno)) {
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| }
|
| if (IsFileSystemSyscall(sysno)) {
|
| return ENOENT;
|
| }
|
| // In any other case crash the program with our SIGSYS handler.
|
| - return playground2::Sandbox::ErrorCode(CrashSIGSYS_Handler, NULL);
|
| + return playground2::Sandbox::Trap(CrashSIGSYS_Handler, NULL);
|
| }
|
| }
|
| #endif
|
|
|
| -playground2::Sandbox::ErrorCode BlacklistPtracePolicy(int sysno) {
|
| +playground2::ErrorCode BlacklistPtracePolicy(int sysno) {
|
| if (sysno < static_cast<int>(MIN_SYSCALL) ||
|
| sysno > static_cast<int>(MAX_SYSCALL)) {
|
| // TODO(jln) we should not have to do that in a trivial policy.
|
| @@ -368,22 +368,22 @@ playground2::Sandbox::ErrorCode BlacklistPtracePolicy(int sysno) {
|
| case __NR_process_vm_writev:
|
| case __NR_migrate_pages:
|
| case __NR_move_pages:
|
| - return playground2::Sandbox::ErrorCode(CrashSIGSYS_Handler, NULL);
|
| + return playground2::Sandbox::Trap(CrashSIGSYS_Handler, NULL);
|
| default:
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| }
|
| }
|
|
|
| // Allow all syscalls.
|
| // This will still deny x32 or IA32 calls in 64 bits mode or
|
| // 64 bits system calls in compatibility mode.
|
| -playground2::Sandbox::ErrorCode AllowAllPolicy(int sysno) {
|
| +playground2::ErrorCode AllowAllPolicy(int sysno) {
|
| if (sysno < static_cast<int>(MIN_SYSCALL) ||
|
| sysno > static_cast<int>(MAX_SYSCALL)) {
|
| // TODO(jln) we should not have to do that in a trivial policy.
|
| return ENOSYS;
|
| } else {
|
| - return playground2::Sandbox::SB_ALLOWED;
|
| + return playground2::ErrorCode::ERR_ALLOWED;
|
| }
|
| }
|
|
|
|
|