Skip to content

Lock WKUSDPreviewView::data and catch unexpected message delivery - #78749

Merged
webkit-commit-queue merged 1 commit into
mainfrom
integration/conflict/013a5ed53075_013a5ed53075_main
Oct 29, 2026
Merged

webkit-commit-queue merged 1 commit into
mainfrom
integration/conflict/013a5ed53075_013a5ed53075_main

Conversation

@webkit-opensource-integration

@webkit-opensource-integration webkit-opensource-integration commented Oct 29, 2026 •

Copy link
Copy Markdown

53ab83c

Lock WKUSDPreviewView::data and catch unexpected message delivery
rdar://180524392

Reviewed by Mike Wyrzykowski.

WKUSDPreviewView::data is accessed on both the main thread and the
QuickLook background queue; add a Lock around it.

Also the didFinishLoadingDataForCustomContentProvider message should
only be sent once after displaying a cursom content provider, so add
checks to catch other sequences from untrusted processes.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SystemPreview.mm

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKUSDPreviewView.mm:
(-[WKUSDPreviewView web_setContentProviderData:suggestedFilename:completionHandler:]):
(-[WKUSDPreviewView provideDataForItem:]):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SystemPreview.mm:
(TestWebKitAPI::TEST(WebKit, SystemPreviewProvideDataForItemIsSafeAgainstConcurrentReassignment)):

Originally-landed-as: 316606.451@safari-7625-branch (013a5ed53075). rdar://191050749
Canonical link: https://commits.webkit.org/325171@main

22eed41

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-cmake-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-cmake-debug
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-cmake-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 gtk-wk2
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@webkit-opensource-integration

Copy link
Copy Markdown
Author

Integration performed the following cherry-picks: 013a5ed for rdar://191050749. 013a5ed caused a merge conflict.

@webkit-opensource-integration

Copy link
Copy Markdown
Author

At the time this pull request was created the following files were in conflict and need to be resolved:

  • Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SystemPreview.mm — modified on both the target branch and the incoming commit (content conflict)

@squelart
squelart force-pushed the integration/conflict/013a5ed53075_013a5ed53075_main branch from 0ef0579 to 22eed41 Compare October 29, 2026 03:25
@squelart squelart added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Oct 29, 2026
@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Oct 29, 2026
@webkit-ews-buildbot

Copy link
Copy Markdown
Collaborator

Safe-Merge-Queue: Build #108999.

rdar://180524392

Reviewed by Mike Wyrzykowski.

WKUSDPreviewView::data is accessed on both the main thread and the
QuickLook background queue; add a Lock around it.

Also the didFinishLoadingDataForCustomContentProvider message should
only be sent once after displaying a cursom content provider, so add
checks to catch other sequences from untrusted processes.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SystemPreview.mm

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKUSDPreviewView.mm:
(-[WKUSDPreviewView web_setContentProviderData:suggestedFilename:completionHandler:]):
(-[WKUSDPreviewView provideDataForItem:]):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SystemPreview.mm:
(TestWebKitAPI::TEST(WebKit, SystemPreviewProvideDataForItemIsSafeAgainstConcurrentReassignment)):

Originally-landed-as: 316606.451@safari-7625-branch (013a5ed). rdar://191050749
Canonical link: https://commits.webkit.org/325171@main
@webkit-commit-queue webkit-commit-queue changed the title Cherry-pick(s) 013a5ed53075. rdar://191050749 Lock WKUSDPreviewView::data and catch unexpected message delivery Oct 29, 2026
@webkit-commit-queue
webkit-commit-queue force-pushed the integration/conflict/013a5ed53075_013a5ed53075_main branch from 22eed41 to 53ab83c Compare October 29, 2026 21:10
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 325171@main (53ab83c): https://commits.webkit.org/325171@main

Reviewed commits have been landed. Closing PR #78749 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 53ab83c into WebKit:main Oct 29, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants