Title: [228928] trunk/Source/WebCore
Revision
228928
Author
cdu...@apple.com
Date
2018-02-22 11:46:18 -0800 (Thu, 22 Feb 2018)

Log Message

ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183046
<rdar://problem/37793395>

Reviewed by Youenn Fablet.

Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228927 => 228928)


--- trunk/Source/WebCore/ChangeLog	2018-02-22 19:41:18 UTC (rev 228927)
+++ trunk/Source/WebCore/ChangeLog	2018-02-22 19:46:18 UTC (rev 228928)
@@ -1,3 +1,17 @@
+2018-02-22  Chris Dumez  <cdu...@apple.com>
+
+        ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=183046
+        <rdar://problem/37793395>
+
+        Reviewed by Youenn Fablet.
+
+        Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
+        The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
+
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::scheduleJob):
+
 2018-02-22  Basuke Suzuki  <basuke.suz...@sony.com>
 
         [Curl] Fix warning on clang.

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp (228927 => 228928)


--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2018-02-22 19:41:18 UTC (rev 228927)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2018-02-22 19:46:18 UTC (rev 228928)
@@ -238,11 +238,11 @@
 
     setPendingActivity(this);
 
-    auto jobData = job->data();
+    auto& jobData = job->data();
     auto result = m_jobMap.add(job->identifier(), WTFMove(job));
     ASSERT_UNUSED(result, result.isNewEntry);
 
-    callOnMainThread([connection = m_swConnection, contextIdentifier = this->contextIdentifier(), jobData = WTFMove(jobData)] {
+    callOnMainThread([connection = m_swConnection, contextIdentifier = this->contextIdentifier(), jobData = jobData.isolatedCopy()] {
         connection->scheduleJob(contextIdentifier, jobData);
     });
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to