Skip to content

Commit

Permalink
ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobDa…
Browse files Browse the repository at this point in the history
…ta 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):


Canonical link: https://commits.webkit.org/198797@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Feb 22, 2018
1 parent d0bf0b6 commit b53e3db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2018-02-22 Chris Dumez <cdumez@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.Suzuki@sony.com>

[Curl] Fix warning on clang.
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Expand Up @@ -238,11 +238,11 @@ void ServiceWorkerContainer::scheduleJob(Ref<ServiceWorkerJob>&& job)

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);
});
}
Expand Down

0 comments on commit b53e3db

Please sign in to comment.