stable

Clone or download

Read-only

Limit the amount of available memory for WASM module

Modify wasmtime-wrapper-lib to limit the amount of memory that a WebAssembly module can use. To do this we implement StoreLimitsBuilder (https://docs.rs/wasmtime/3.0.1/wasmtime/struct.StoreLimitsBuilder.html) To build pre-receive-hook-example.wasm (required for proper testing): - cd tuleap/src/additional-packages/pre-receive-hook-example/ - nix-shell - cargo build --target wasm32-wasi --release To build and test libwasmtimewrapper.so: - Build pre-receive-hook-example.wasm (as described above) - cd tuleap/src/additional-packages/wasmtime-wrapper-lib/ - nix-shell - cargo zigbuild --target x86_64-unknown-linux-gnu.2.17 --release - cargo test Part of story #28845 have an hidden command executing custom command to determine if the reference should have been rejected Change-Id: Ief2790cac1cab4c43f8d18ebca1817b14480cc92

Modified Files

Name
M src/additional-packages/wasmtime-wrapper-lib/src/lib.rs +72 −7 Go to diff View file
M src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/Cargo.toml +5 −1 Go to diff View file
A src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/src/memory-alloc-fail/main.rs +26 −0 Go to diff View file