From bee16c0bf837e872690db347d42a183e0daa6eb0 Mon Sep 17 00:00:00 2001 From: "tommycli@chromium.org" Date: Mon, 16 Sep 2013 20:30:48 +0000 Subject: ChildProcessSecurityPolicy: Port FileAPIMessageFilter to use new checks This CL: * Closes the P1 security hole described in http://crbug.com/284792 by changing the message contents to contain Pepper file open flags instead of base::PlatformFileFlags and checking those in FileAPIMessageFilter. * Ports the rest of FileAPIMessageFilter to use new CPSP calls. * Ports one call in ResourceDispatcherHostImpl. * Makes base::PlatformFileFlags-based methods private in CPSP. Refactoring document / plans here: https://docs.google.com/a/google.com/document/d/1QGkGWuwgSuaRqovz4wyb0upqPKDVsgYOFKt44E7gmOE/edit?usp=sharing BUG=262142,284792 Review URL: https://chromiumcodereview.appspot.com/23760004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223399 0039d316-1c4b-4281-b951-d872f2087c98 --- content/child/fileapi/file_system_dispatcher.cc | 8 ++++---- content/child/fileapi/file_system_dispatcher.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'content/child') diff --git a/content/child/fileapi/file_system_dispatcher.cc b/content/child/fileapi/file_system_dispatcher.cc index 095dc58..c564f8d 100644 --- a/content/child/fileapi/file_system_dispatcher.cc +++ b/content/child/fileapi/file_system_dispatcher.cc @@ -324,16 +324,16 @@ void FileSystemDispatcher::TouchFile( request_id, path, last_access_time, last_modified_time)); } -void FileSystemDispatcher::OpenFile( +void FileSystemDispatcher::OpenPepperFile( const GURL& file_path, - int file_flags, + int pp_open_flags, const OpenFileCallback& success_callback, const StatusCallback& error_callback) { int request_id = dispatchers_.Add( CallbackDispatcher::Create(success_callback, error_callback)); ChildThread::current()->Send( - new FileSystemHostMsg_OpenFile( - request_id, file_path, file_flags)); + new FileSystemHostMsg_OpenPepperFile( + request_id, file_path, pp_open_flags)); } void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { diff --git a/content/child/fileapi/file_system_dispatcher.h b/content/child/fileapi/file_system_dispatcher.h index 7c34ba7..f3957c3 100644 --- a/content/child/fileapi/file_system_dispatcher.h +++ b/content/child/fileapi/file_system_dispatcher.h @@ -122,10 +122,10 @@ class FileSystemDispatcher : public IPC::Listener { // This returns a raw open PlatformFile, unlike the above, which are // self-contained operations. - void OpenFile(const GURL& file_path, - int file_flags, // passed to FileUtilProxy::CreateOrOpen - const OpenFileCallback& success_callback, - const StatusCallback& error_callback); + void OpenPepperFile(const GURL& file_path, + int pp_open_flags, + const OpenFileCallback& success_callback, + const StatusCallback& error_callback); // This must be paired with OpenFile, and called after finished using the // raw PlatformFile returned from OpenFile. void NotifyCloseFile(int file_open_id); -- cgit v1.1