Skip to content

fix(environ): repair unsound StringPool::try_clone()#12906

Open
flavio wants to merge 1 commit intobytecodealliance:mainfrom
flavio:fix-stringpool-clone
Open

fix(environ): repair unsound StringPool::try_clone()#12906
flavio wants to merge 1 commit intobytecodealliance:mainfrom
flavio:fix-stringpool-clone

Conversation

@flavio
Copy link
Copy Markdown
Contributor

@flavio flavio commented Mar 31, 2026

This is a fix for #12905

The 43.0 release introduced a soundness bug in StringPool::try_clone(): the cloned map retains &'static str keys pointing into the original pool's strings storage. Once the original Linker is dropped those keys dangle.

Cloning a Linker, then dropping the original one, leaves a linker whose registered imports could no longer be found, causing instantiation to fail with unknown import.

The 43.0 release introduced a soundness bug in StringPool::try_clone(): the
cloned map retains &'static str keys pointing into the original pool's
strings storage. Once the original Linker is dropped those keys dangle.

Cloning a Linker, then dropping the original one, leaves a linker whose
registered imports could no longer be found, causing instantiation to
fail with "unknown import".

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio requested a review from a team as a code owner March 31, 2026 12:54
@flavio flavio requested review from fitzgen and removed request for a team March 31, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant