stable

Clone or download

Read-only

Limit execution time of WASM modules

Modify wasmtime-wrapper-lib to limit the maximum execution time for WebAssembly modules. To achieve this we use the epoch_deadline mechanism (https://docs.rs/wasmtime/3.0.1/wasmtime/struct.Store.html#method.set_epoch_deadline) 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: Id0d84f1359b0c1bb80fe00884411c644cfefa86c

Modified Files

Name
M src/additional-packages/wasmtime-wrapper-lib/build.rs +17 −0 Go to diff View file
M src/additional-packages/wasmtime-wrapper-lib/shell.nix +4 −1 Go to diff View file
M src/additional-packages/wasmtime-wrapper-lib/src/lib.rs +102 −19 Go to diff View file
A src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/Cargo.lock +7 −0 Go to diff View file
A src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/Cargo.toml +12 −0 Go to diff View file
A src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/src/running-time/main.rs +22 −0 Go to diff View file
A src/additional-packages/wasmtime-wrapper-lib/test-wasm-modules/src/wrong-json/main.rs +22 −0 Go to diff View file