Skip to content

uaf: Fix page double-free on navigate failure. - #3098

Merged
karlseguin merged 1 commit into
mainfrom
page-double-free
Aug 2, 2026
Merged

uaf: Fix page double-free on navigate failure.#3098
karlseguin merged 1 commit into
mainfrom
page-double-free

Conversation

@karlseguin

Copy link
Copy Markdown
Collaborator

This is a classic (for us) issue. Session.initiateRootNavigation errdefer a number of steps BUT, if the frame.navigate() call reaches libcurl's event-loop, then those errdefer can conflict with the frameErrorCallback. Who's responsible for cleaning up? It depends where the failure happened.

So the cleanup is now more defensive. Page.destroying guards against multiple calls to Session.queuePageDestruction and initiateRootNavigation no longer assumes that the new Page is in the pages collection.

I believe this is the cause of the "release overflow" for Selection that is infrequent but has been seen for a long time.

This is a classic (for us) issue. Session.initiateRootNavigation errdefer a
number of steps BUT, if the frame.navigate() call reaches libcurl's event-loop,
then those errdefer can conflict with the `frameErrorCallback`. Who's
responsible for cleaning up? It depends where the failure happened.

So the cleanup is now more defensive. Page.destroying guards against multiple
calls to Session.queuePageDestruction and initiateRootNavigation no longer
assumes that the new Page is in the pages collection.

I believe this is the cause of the "release overflow" for `Selection` that is
infrequent but has been seen for a long time.
@karlseguin
karlseguin merged commit 70bbdad into main Aug 2, 2026
26 checks passed
@karlseguin
karlseguin deleted the page-double-free branch August 2, 2026 00:49
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant