Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash under NetworkProcess::addAllowedFirstPartyForCookies() #11506

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Mar 14, 2023

@cdumez cdumez self-assigned this Mar 14, 2023
@cdumez cdumez added the WebKit2 Bugs relating to the WebKit2 API layer label Mar 14, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 14, 2023
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Mar 14, 2023
@cdumez cdumez force-pushed the 253895_addAllowedFirstPartyForCookies_crash branch from eb6e9f3 to 514fd82 Compare March 14, 2023 19:10
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 14, 2023
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Mar 14, 2023
@cdumez cdumez force-pushed the 253895_addAllowedFirstPartyForCookies_crash branch from 514fd82 to 6d2fe4a Compare March 14, 2023 19:16
@@ -395,6 +395,9 @@ void NetworkProcess::createNetworkConnectionToWebProcess(ProcessIdentifier ident

void NetworkProcess::addAllowedFirstPartyForCookies(WebCore::ProcessIdentifier processIdentifier, WebCore::RegistrableDomain&& firstPartyForCookies, LoadedWebArchive loadedWebArchive, CompletionHandler<void()>&& completionHandler)
{
if (!HashSet<WebCore::RegistrableDomain>::isValidValue(firstPartyForCookies))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to NetworkProcess::webProcessWillLoadWebArchive too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decltype(m_allowedFirstPartiesForCookies)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a little more complicated than this, here is the type:
HashMap<WebCore::ProcessIdentifier, std::pair<LoadedWebArchive, HashSet<WebCore::RegistrableDomain>>>

I only care about the inner HashSet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webProcessWillLoadWebArchive

webProcessWillLoadWebArchive doesn't modify the HashSet containing RegistrableDomains, only the top-level HashMap.

@@ -395,6 +395,9 @@ void NetworkProcess::createNetworkConnectionToWebProcess(ProcessIdentifier ident

void NetworkProcess::addAllowedFirstPartyForCookies(WebCore::ProcessIdentifier processIdentifier, WebCore::RegistrableDomain&& firstPartyForCookies, LoadedWebArchive loadedWebArchive, CompletionHandler<void()>&& completionHandler)
{
if (!HashSet<WebCore::RegistrableDomain>::isValidValue(firstPartyForCookies))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decltype(m_allowedFirstPartiesForCookies)

@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Mar 14, 2023
https://bugs.webkit.org/show_bug.cgi?id=253895
rdar://104526219

Reviewed by Alex Christensen.

Make sure the registrable domain is valid before we try inserting it into the
HashSet.

* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::addAllowedFirstPartyForCookies):

Canonical link: https://commits.webkit.org/261656@main
@webkit-commit-queue webkit-commit-queue force-pushed the 253895_addAllowedFirstPartyForCookies_crash branch from 6d2fe4a to e2b561a Compare March 14, 2023 22:35
@webkit-commit-queue
Copy link
Collaborator

Committed 261656@main (e2b561a): https://commits.webkit.org/261656@main

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

@webkit-commit-queue webkit-commit-queue merged commit e2b561a into WebKit:main Mar 14, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit2 Bugs relating to the WebKit2 API layer
Projects
None yet
5 participants