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

Unified Diff: content/zygote/zygote_main_linux.cc

Issue 11231021: Zygote: Initialize NSS fully (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_main_linux.cc
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index 4cd81054c2528318103d7ca0b8f257ccf2509c17..d00f7ee01648283fd62e8581e6f72174931b2e9d 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -490,6 +490,25 @@ bool ZygoteMain(const MainFunctionParams& params,
int sandbox_flags = linux_sandbox->GetStatus();
+#if defined(USE_NSS)
ddorwin 2012/10/20 00:45:32 If we take this patch, should we remove http://cod
jln (very slow on Chromium) 2012/10/20 01:14:09 This comment is misleading on Linux. On Linux the
+ // Do some extra NSS initialization. We don't want to do this pre-sandbox
+ // because it's not well defined what venues of attacks it could create.
+ //
+ // In addition to the benfit of doing this initialization only once, (it
+ // will be inherited), this is a good warm-up before we enable our next layer
+ // of sandbox, e.g. seccomp-bpf.
+
+ // We will soon fork, but we haven't loaded any security module.
+ crypto::DisableNSSForkCheck();
Ryan Sleevi 2012/10/19 23:50:10 Is modifying the |env| like this permitted at this
jln (very slow on Chromium) 2012/10/20 00:51:30 I didn't now that the env was affected, but I don'
+ // Without this line on Linux, HMAC::Init will instantiate a singleton that
+ // in turn attempts to open a file.
Ryan Sleevi 2012/10/19 23:50:10 drop the comment on 503-504. It doesn't matter wha
jln (very slow on Chromium) 2012/10/20 00:51:30 Done.
+ // The sandbox will prevent that anyway, but if it didn't, this would also
+ // leak descriptors to private files.
Ryan Sleevi 2012/10/19 23:50:10 What files are being opened? What descriptors are
jln (very slow on Chromium) 2012/10/20 00:51:30 I modified it to make it more generic. What we don
+ crypto::ForceNSSNoDBInit();
+ // Initialize NSS, every child process will benefit from it.
+ crypto::EnsureNSSInit();
Ryan Sleevi 2012/10/19 23:50:10 s/benefit/suffer/ :) It's not clear to me what ho
jln (very slow on Chromium) 2012/10/20 00:51:30 When this function is called, NSS will make some s
+#endif
+
Zygote zygote(sandbox_flags, forkdelegate);
// This function call can return multiple times, once per fork().
return zygote.ProcessRequests();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698