Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit fixes a few issues where it was possible to represent a wasm shared linear memory with the wasmtime::Memory type. This is not sound because wasmtime::Memory provides safe Rust access to the bytes where that is not possible with wasm shared memories. Shared memories in Rust must be represented by SharedMemory, not wasmtime::Memory.

Specifically this commit prevents two vectors of this happening:

  1. Memory::new now requires that the memory type specified is non-shared. Instead SharedMemory::new must be used instead.

  2. Core dumps now skip over shared memories when iterating over all memories in the store. Supporting shared memories is a more invasive change and will happen on Wasmtime's main branch.

This commit fixes a few issues where it was possible to represent a wasm
shared linear memory with the `wasmtime::Memory` type. This is not sound
because `wasmtime::Memory` provides safe Rust access to the bytes where
that is not possible with wasm shared memories. Shared memories in Rust
must be represented by `SharedMemory`, not `wasmtime::Memory`.

Specifically this commit prevents two vectors of this happening:

1. `Memory::new` now requires that the memory type specified is
   non-shared. Instead `SharedMemory::new` must be used instead.

2. Core dumps now skip over shared memories when iterating over all
   memories in the store. Supporting shared memories is a more invasive
   change and will happen on Wasmtime's `main` branch.
@alexcrichton alexcrichton requested review from a team as code owners November 11, 2025 15:37
@alexcrichton alexcrichton requested review from dicej and removed request for a team November 11, 2025 15:37
@alexcrichton
Copy link
Member Author

Carrying over @pchickey's approval from the security advisory.

@alexcrichton alexcrichton merged commit 9ebb693 into bytecodealliance:release-38.0.0 Nov 11, 2025
170 checks passed
@alexcrichton alexcrichton deleted the release-38.0.0 branch November 11, 2025 17:58
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