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

Unified Diff: sandbox/linux/seccomp-bpf/sandbox_bpf.cc

Issue 108173008: Linux Sandbox: check no threads before fork(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « no previous file | sandbox/linux/services/broker_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/sandbox_bpf.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index b598d769ba15b6f251a3f724f83c2033ab91d0b8..9fe503134015df4d3bd3ed1325b91b05172ee773 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -268,6 +268,10 @@ bool Sandbox::RunFunctionInPolicy(void (*code_in_sandbox)(),
SANDBOX_DIE("Process started without standard file descriptors");
}
+ // This code is using fork() and should only ever run single threaded.
Jorge Lucangeli Obes 2013/12/10 21:14:08 nit: single-threaded.
jln (very slow on Chromium) 2013/12/10 21:42:00 Done.
+ // Most of the code below is "async-signal-safe" and only minor changes
+ // would be needed to support threads.
+ DCHECK(IsSingleThreaded(proc_fd_));
pid_t pid = fork();
if (pid < 0) {
// Die if we cannot fork(). We would probably fail a little later
« no previous file with comments | « no previous file | sandbox/linux/services/broker_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698