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

Unified Diff: chrome/browser/sandbox_policy.cc

Issue 2458: Use the new dll injection blocking api of the sandbox to block... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « chrome/browser/sandbox_policy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sandbox_policy.cc
===================================================================
--- chrome/browser/sandbox_policy.cc (revision 2087)
+++ chrome/browser/sandbox_policy.cc (working copy)
@@ -92,6 +92,30 @@
return true;
}
+// Eviction of injected DLLs is done by the sandbox. An interception on a
+// system call is added such that the blacklisted dll, don't fully load so
+// the injected module does not get a chance to execute any code.
+bool AddDllEvictionPolicy(sandbox::TargetPolicy* policy) {
+ // List of dlls to unmap.
+ const wchar_t* troublesome_dlls[] = {
+ L"smumhook.dll", // Spyware Doctor version 5 and above.
+ L"GoogleDesktopNetwork3.DLL", // Google Desktop Search v5.
+ L"npggNT.des", // GameGuard version 2008. It is a packed dll.
+ };
+
+ for(int ix = 0; ix != arraysize(troublesome_dlls); ++ix) {
+ // To minimize the list we only add an unload policy if the dll is also
+ // loaded in this process. All the injected dlls of interest do this.
+ if (::GetModuleHandleW(troublesome_dlls[ix])) {
+ LOG(WARNING) << "dll to unload found: " << troublesome_dlls[ix];
+ if (sandbox::SBOX_ALL_OK != policy->AddDllToUnload(troublesome_dlls[ix]))
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool AddGenericPolicy(sandbox::TargetPolicy* policy) {
sandbox::ResultCode result;
« no previous file with comments | « chrome/browser/sandbox_policy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698