-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Limit untrusted allocations when decoding Vectors to 1MB #9699
Limit untrusted allocations when decoding Vectors to 1MB #9699
Conversation
EWS run on previous version of this PR (hash 3c59e4d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
This should be testable, probably in some test similar to ArgumentCoderSpanTest
but probably it needs a new fixture.. The test would be one where the encode encodes size_t big value and decoder decodes Vector and the test would test that decoder decodes nullopt instead of a crash.
3c59e4d
to
55a3be2
Compare
EWS run on current version of this PR (hash 55a3be2) |
https://bugs.webkit.org/show_bug.cgi?id=251804 Reviewed by Kimmo Kinnunen. 257725@main introduced a performance improvement where we only allocate exactly as much memory as we need once when decoding a Vector. This is wonderful, but it introduced allocation based on size from an untrusted source, making it so any message that sends a Vector can be used to send a very large size_t and crash the other process. In this PR I get the best of both worlds: if the total allocation size is less that 1MB then we do the fast and efficient thing, but if it is more than 1MB we do the safe thing. * Source/WebKit/Platform/IPC/ArgumentCoders.h: Canonical link: https://commits.webkit.org/259917@main
55a3be2
to
23f2542
Compare
Committed 259917@main (23f2542): https://commits.webkit.org/259917@main Reviewed commits have been landed. Closing PR #9699 and removing active labels. |
23f2542
55a3be2
π iosπ macπ π§ͺ winπ mac-AS-debugπ gtkπ wincairoπ§ͺ ios-wk2π§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk1π§ͺ api-gtkπ tvπ§ͺ mac-wk2π§ͺ mac-AS-debug-wk2π§ͺ mac-wk2-stressπ watch-sim