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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 1852153002: Avoid adding Mojo service to the utility process when running with elevated privileges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 85cbd630dd66f88a15a17687789d87583cbb9bb7..e7f7ac2098be7a38265617dbefbac450528b94fc 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -197,6 +197,15 @@ bool ChromeContentUtilityClient::OnMessageReceived(
void ChromeContentUtilityClient::RegisterMojoServices(
content::ServiceRegistry* registry) {
+ // When the utility process is running with elevated privileges, we need to
+ // filter messages so that only a whitelist of IPCs can run. In Mojo, there's
+ // no way of filtering individual messages. Instead, we can avoid adding
+ // non-whitelisted Mojo services to the ServiceRegistry.
+ // TODO(amistry): Use a whitelist once the whistlisted IPCs have been
+ // converted to Mojo.
+ if (filter_messages_)
+ return;
+
#if !defined(OS_ANDROID)
registry->AddService<net::interfaces::ProxyResolverFactory>(
base::Bind(CreateProxyResolverFactory));
« 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