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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 11471011: Add PPAPI permissions for the testing interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | chrome/renderer/pepper/ppb_nacl_private_impl.cc » ('j') | ppapi/proxy/ppb_testing_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/nacl_process_host.cc
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index 8890b9484dd670986e0362ec429836a1e5ca272d..3119c1b1dd9b1bce1b6c89aeabf41b6821d4f005 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -115,6 +115,14 @@ bool ShareHandleToSelLdr(
return true;
}
+ppapi::PpapiPermissions GetNaClPermissions(uint32 permission_bits) {
bbudge 2012/12/07 22:23:41 Good idea to restrict the permissions requested by
+ // Only allow NaCl plugins to request certain permissions. We don't want
+ // a compromised renderer to be able to start a nacl plugin with e.g. Flash
+ // permissions which may expand the surface area of the sandbox.
+ uint32 masked_bits = permission_bits & ppapi::PERMISSION_DEV;
+ return ppapi::PpapiPermissions::GetForCommandLine(masked_bits);
+}
+
} // namespace
struct NaClProcessHost::NaClInternal {
@@ -138,7 +146,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
uint32 permission_bits,
bool off_the_record)
: manifest_url_(manifest_url),
- permissions_(ppapi::PpapiPermissions::GetForCommandLine(permission_bits)),
+ permissions_(GetNaClPermissions(permission_bits)),
#if defined(OS_WIN)
process_launched_by_broker_(false),
#elif defined(OS_LINUX)
« no previous file with comments | « no previous file | chrome/renderer/pepper/ppb_nacl_private_impl.cc » ('j') | ppapi/proxy/ppb_testing_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698