Stream: git-wasmtime

Topic: wasmtime / PR #8283 Fix a panic using tables with the wro...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 14:51):

alexcrichton requested wasmtime-core-reviewers for a review on PR #8283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 14:51):

alexcrichton requested fitzgen for a review on PR #8283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 14:51):

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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 15:00):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 15:17):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2024 at 16:26):

alexcrichton merged PR #8283.


Last updated: Oct 23 2024 at 20:03 UTC