[webkit-changes] [WebKit/WebKit] d2d2c6: Fix thread safety issue in WebCoreNSURLSession::da...

Chris Dumez noreply at github.com
Thu Nov 10 16:03:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d2d2c6ba138cbaa8d2bdb21c71b41059a66095c6
      https://github.com/WebKit/WebKit/commit/d2d2c6ba138cbaa8d2bdb21c71b41059a66095c6
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h
    M Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm

  Log Message:
  -----------
  Fix thread safety issue in WebCoreNSURLSession::dataTaskWithRequest
https://bugs.webkit.org/show_bug.cgi?id=247755

Reviewed by Jean-Yves Avenard.

[WebCoreNSURLSession dataTaskWithRequest:] gets called from multiple threads inside
the GPUProcess. As a result, generating the task identifier via _nextTaskIdentifier
was not safe since _nextTaskIdentifier is not atomic or guarded by a lock.

Use a std::atomic<uint64_t> for _nextTaskIdentifier to address the issue. I suspect
this could be the cause for <rdar://99187423> but I can't be sure since I was unable
to reproduce the crash.

* Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h:
* Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dataTaskWithRequest:]):

Canonical link: https://commits.webkit.org/256551@main




More information about the webkit-changes mailing list