| OLD | NEW |
| 1 // Copyright (c) 2010 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. |
| 4 |
| 1 #include "debug.h" | 5 #include "debug.h" |
| 2 #include "sandbox_impl.h" | 6 #include "sandbox_impl.h" |
| 3 | 7 |
| 4 namespace playground { | 8 namespace playground { |
| 5 | 9 |
| 6 int Sandbox::sandbox_clone(int flags, void* stack, int* pid, int* ctid, | 10 int Sandbox::sandbox_clone(int flags, void* stack, int* pid, int* ctid, |
| 7 void* tls, void *wrapper_sp) { | 11 void* tls, void *wrapper_sp) { |
| 8 Debug::syscall(__NR_clone, "Executing handler"); | 12 Debug::syscall(__NR_clone, "Executing handler"); |
| 9 struct { | 13 struct { |
| 10 int sysnum; | 14 int sysnum; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 mem->rdi = clone_req.regs64.rdi; | 81 mem->rdi = clone_req.regs64.rdi; |
| 78 mem->r8 = clone_req.regs64.r8; | 82 mem->r8 = clone_req.regs64.r8; |
| 79 mem->r9 = clone_req.regs64.r9; | 83 mem->r9 = clone_req.regs64.r9; |
| 80 mem->r10 = clone_req.regs64.r10; | 84 mem->r10 = clone_req.regs64.r10; |
| 81 mem->r11 = clone_req.regs64.r11; | 85 mem->r11 = clone_req.regs64.r11; |
| 82 mem->r12 = clone_req.regs64.r12; | 86 mem->r12 = clone_req.regs64.r12; |
| 83 mem->r13 = clone_req.regs64.r13; | 87 mem->r13 = clone_req.regs64.r13; |
| 84 mem->r14 = clone_req.regs64.r14; | 88 mem->r14 = clone_req.regs64.r14; |
| 85 mem->r15 = clone_req.regs64.r15; | 89 mem->r15 = clone_req.regs64.r15; |
| 86 #elif defined(__i386__) | 90 #elif defined(__i386__) |
| 87 mem->ret2 = clone_req.regs32.ret2; | |
| 88 mem->ebp = clone_req.regs32.ebp; | 91 mem->ebp = clone_req.regs32.ebp; |
| 89 mem->edi = clone_req.regs32.edi; | 92 mem->edi = clone_req.regs32.edi; |
| 90 mem->esi = clone_req.regs32.esi; | 93 mem->esi = clone_req.regs32.esi; |
| 91 mem->edx = clone_req.regs32.edx; | 94 mem->edx = clone_req.regs32.edx; |
| 92 mem->ecx = clone_req.regs32.ecx; | 95 mem->ecx = clone_req.regs32.ecx; |
| 93 mem->ebx = clone_req.regs32.ebx; | 96 mem->ebx = clone_req.regs32.ebx; |
| 94 #else | 97 #else |
| 95 #error Unsupported target platform | 98 #error Unsupported target platform |
| 96 #endif | 99 #endif |
| 97 newMem->sequence = 0; | 100 newMem->sequence = 0; |
| 98 newMem->shmId = -1; | 101 newMem->shmId = -1; |
| 99 mem->newSecureMem = newMem; | 102 mem->newSecureMem = newMem; |
| 100 mem->processFdPub = processFdPub_; | 103 mem->processFdPub = processFdPub_; |
| 101 mem->cloneFdPub = cloneFdPub_; | 104 mem->cloneFdPub = cloneFdPub_; |
| 102 | 105 |
| 103 SecureMem::sendSystemCall(threadFdPub, true, parentMapsFd, mem, | 106 SecureMem::sendSystemCall(threadFdPub, true, parentMapsFd, mem, |
| 104 __NR_clone, clone_req.flags, clone_req.stack, | 107 __NR_clone, clone_req.flags, clone_req.stack, |
| 105 clone_req.pid, clone_req.ctid, clone_req.tls); | 108 clone_req.pid, clone_req.ctid, clone_req.tls); |
| 106 return true; | 109 return true; |
| 107 } | 110 } |
| 108 } | 111 } |
| 109 } | 112 } |
| 110 | 113 |
| 111 } // namespace | 114 } // namespace |
| OLD | NEW |