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

LibWeb: Commit pull-into descriptors after filling from queue #2694

Conversation

kennethmyhra
Copy link
Contributor

This aligns us with the latest streams specification changes to accommodate for the security advisor GHSA-p5g2-876g-95h9.
See relevant links:
GHSA-p5g2-876g-95h9
whatwg/streams#1326

Previously we would just crash on an assert in ReadableByteStreamControllerFillHeadPullIntoDescriptor which verifies that controller controller.raw_byob_request() should be null.

These changes make sure that we postpone calls to ReadableByteStreamControllerCommitPullIntoDescriptor until after all
pull-into descriptors have been filled up by ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue.

The attached test verifies that a patched then() will see a null byobRequest.

@kennethmyhra kennethmyhra changed the title LibWeb: Add AO CanCopyDataBlockBytes() LibWeb: Commit pull-into descriptors after filling from queue Dec 1, 2024
@kennethmyhra kennethmyhra force-pushed the commit-pull-into-descriptors-after-filling-from-queue branch from b028857 to 6fe9f34 Compare December 2, 2024 09:38
@kennethmyhra
Copy link
Contributor Author

Thanks, Shannon! Updated the spec comments as suggested and pulled in the relevant WPT test.

These changes make sure that we postpone calls to
ReadableByteStreamControllerCommitPullIntoDescriptor until after all
pull-into descriptors have been filled up by
ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue.

Also pulls in the WPT test which was created in relation to this spec
change. The test verifies that a patched then() will see a null
byobRequest.
@kennethmyhra kennethmyhra force-pushed the commit-pull-into-descriptors-after-filling-from-queue branch from 6fe9f34 to 02088a7 Compare December 3, 2024 10:03
@trflynn89 trflynn89 merged commit 861f6e3 into LadybirdBrowser:master Dec 5, 2024
6 checks passed
@kennethmyhra kennethmyhra deleted the commit-pull-into-descriptors-after-filling-from-queue branch December 5, 2024 19:53
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.

3 participants