Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request from GHSA-88xq-w8cq-xfg7
This commit fixes the drop of an uninitialized `VMExternRef` for an `externref` global in an instance that failed to be allocated by the pooling instance allocator. The following engine configuration (via `Config`) is required to be impacted by this bug: * support for the reference types proposal must be enabled (this is the default for `Config`). * a pooling allocation strategy must be configured via `Config::allocation_strategy`, which is not the default allocation strategy. A module must be instantiated with the following characteristics: * The module defines at least one table or memory. * The module defines at least one `externref` global. During instantiation, one of the following must occur to cause the instantiation to fail: * a call to `mprotect` or `VirtualAlloc` fails (e.g. out-of-memory conditions). * a resource limiter was configured in the associated Store (via `Store::limiter` or `Store::limiter_async`) and the limiter returns false from the initial call to grow_memory or grow_table. This results in a partially-initialized instance being dropped and that attempts to drop the uninitialized `VMExternRef` representing the defined `externref` global. The fix is to track whether or not the `VMContext` of the instance has been fully initialized and skip the dropping of globals if not.
- Loading branch information
1 parent
39b88e4
commit 886ecc5
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters