alexcrichton requested wasmtime-core-reviewers for a review on PR #8283.
alexcrichton requested fitzgen for a review on PR #8283.
alexcrichton opened PR #8283 from alexcrichton:fix-panic-with-dropped-segment
to bytecodealliance:main
:
This commit fixes an accidental issue introduced in #8018 where using an element segment which had been dropped with an
externref
table would cause a panic. The panic happened due to an assertion that tables are being used with the right type of item and that was being mismatched. The underlying issue was that dropped element segments are modeled as an empty element segment but the empty element segment was using the "functions" encoding as opposed to the "expressions" encoding. This meant that code later assumed that due to the use of functions the table must be a table-of-functions, but this was not correct for externref-based tables.The fix in this commit is to instead model the encoding as an "expressions" list which means that the table type is dispatched on to call the appropriate initializer.
There is no memory safety issue with this mistake as the assertion was specifically targetted at preventing memory safety. This does, however, enable any WebAssembly module to panic a host.
Closes #8281
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton commented on PR #8283:
As I noted on the issue and per our policy this is actually a security vulnerability. I'll work on getting a 19.0.1 out today with this fix.
fitzgen submitted PR review.
alexcrichton merged PR #8283.
Last updated: Dec 23 2024 at 12:05 UTC