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

Unified Diff: chrome/nacl/nacl_ipc_adapter.cc

Issue 18063005: Do PPB_FileIO Query and Read in the plugin process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECK, which breaks trusted plugins. Created 7 years, 5 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 | content/renderer/pepper/pepper_file_io_host.h » ('j') | ppapi/proxy/file_io_resource.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_ipc_adapter.cc
diff --git a/chrome/nacl/nacl_ipc_adapter.cc b/chrome/nacl/nacl_ipc_adapter.cc
index 845150ea51c85da09eef15d2d40a12da7e8d0434..6f5504928dccab2cbc8997e2c1af218d78d1a450 100644
--- a/chrome/nacl/nacl_ipc_adapter.cc
+++ b/chrome/nacl/nacl_ipc_adapter.cc
@@ -435,6 +435,12 @@ bool NaClIPCAdapter::OnMessageReceived(const IPC::Message& msg) {
break;
}
case ppapi::proxy::SerializedHandle::FILE:
+ // IMPORTANT: The NaClDescIoDescFromHandleAllocCtor function creates
+ // a NaClDesc that checks the flags before reading and writing. This
+ // is necessary since PPB_FileIO now sends a file descriptor which may
+ // have write capabilities, and we don't want the plugin to be able to
dmichael (off chromium) 2013/07/18 20:28:09 "may have write capabilities"... we intend not to
bbudge 2013/07/18 21:28:16 It's non-trivial to create and share a fd with dif
+ // write with it and so bypass quota checks, which still happen in the
+ // host.
nacl_desc.reset(new NaClDescWrapper(NaClDescIoDescFromHandleAllocCtor(
#if defined(OS_WIN)
iter->descriptor(),
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_file_io_host.h » ('j') | ppapi/proxy/file_io_resource.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698