Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1224)

Unified Diff: sandbox/linux/seccomp/trusted_process.cc

Issue 997009: Compute and pring the time that it takes to execute system calls. This data... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/seccomp/syscall.cc ('k') | sandbox/linux/seccomp/trusted_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/trusted_process.cc
===================================================================
--- sandbox/linux/seccomp/trusted_process.cc (revision 41782)
+++ sandbox/linux/seccomp/trusted_process.cc (working copy)
@@ -20,6 +20,7 @@
if (!secureMemPool_.empty()) {
SecureMem::Args* rc = secureMemPool_.back();
secureMemPool_.pop_back();
+ memset(rc->scratchPage, 0, sizeof(rc->scratchPage));
return rc;
}
return NULL;
@@ -27,6 +28,16 @@
void Sandbox::trustedProcess(int parentMapsFd, int processFdPub, int sandboxFd,
int cloneFd, SecureMem::Args* secureArena) {
+ // The trusted process doesn't have access to TLS. Zero out the segment
+ // registers so that we can later test that we are in the trusted process.
+ #if defined(__x86_64__)
+ asm volatile("mov %0, %%gs\n" : : "r"(0));
+ #elif defined(__i386__)
+ asm volatile("mov %0, %%fs\n" : : "r"(0));
+ #else
+ #error Unsupported target platform
+ #endif
+
std::map<long long, struct Thread> threads;
SysCalls sys;
long long cookie = 0;
« no previous file with comments | « sandbox/linux/seccomp/syscall.cc ('k') | sandbox/linux/seccomp/trusted_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698