Stream: git-wasmtime

Topic: wasmtime / PR #13027 More strictly check bounds in FACT t...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 20:53):

alexcrichton opened PR #13027 from alexcrichton:harden-strings to bytecodealliance:main:

Note: this is temporarily rebased on https://github.com/bytecodealliance/wasmtime/pull/13026

This commit is a hardening of the various in-bounds checks and such of
the FACT compiler, in particular as related to strings. The previous
implementation would check bounds in a few places but this was a bit
ad-hoc and not uniformly done. There's no known issue with the prior
checks, but given the sensitive nature of these checks I feel it's best
to make this a bit more rigorous.

Specifically the malloc helpers, and a newly added realloc helper,
will internally verify not only alignment but additionally the size of
the allocation itself. All manual invocations of realloc are switched
over to this helper. Additionally all conversion of a guest pointer to a
more structured value now additionally goes through helpers which
performs these same checks to ensure that everything is in-bounds.

The net result is that this should have no behavior change from before.
A suite of tests are added for behavior around large strings,
specifically exercising the maximum allowable size of strings. This
uncovered a few minor issues in transcoding where spec-wise Wasmtime
previously transcoded too many bytes before performing a
growing realloc.

Finally a few refactorings were done in FACT to handle some helpers
going away, notably around translating the map<K, V> type, which
cleans up the internals as well.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 20:53):

alexcrichton requested uweigand for a review on PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 20:53):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 20:53):

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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 20:53):

alexcrichton requested cfallin for a review on PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:00):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:00):

cfallin has enabled auto merge for PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:06):

cfallin added PR #13027 More strictly check bounds in FACT trampolines to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:08):

alexcrichton removed PR #13027 More strictly check bounds in FACT trampolines from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:25):

alexcrichton updated PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:25):

alexcrichton has enabled auto merge for PR #13027.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 21:39):

alexcrichton added PR #13027 More strictly check bounds in FACT trampolines to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 22:12):

alexcrichton removed PR #13027 More strictly check bounds in FACT trampolines from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 22:12):

alexcrichton merged PR #13027.


Last updated: Apr 12 2026 at 23:10 UTC