Index: chrome/nacl/nacl_ipc_adapter.cc |
diff --git a/chrome/nacl/nacl_ipc_adapter.cc b/chrome/nacl/nacl_ipc_adapter.cc |
index a25709908109bbfe947416768412ee60fc7af0a1..e94c761bfaf0ceb0a42ccb115a54188a2c911acb 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 |
+ // 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(), |