Update memfd support with a runtime toggle (#3778)

This commit updates the `memfd` support in Wasmtime to have a runtime
toggle as to whether it's used or not. The compile-time feature gating
`memfd` support is now also re-enabled by default, but the new runtime
switch is still disabled-by-default.

Additionally this commit updates our fuzz oracle to turn on/off the
memfd flag to re-enable fuzzing with memfd on oss-fuzz.
This commit is contained in:
Alex Crichton
2022-02-08 15:47:13 -06:00
committed by GitHub
parent 4f01711d42
commit 5cd97c054d
6 changed files with 62 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ pub struct WasmtimeConfig {
pub(crate) consume_fuel: bool,
memory_config: MemoryConfig,
force_jump_veneers: bool,
memfd: bool,
}
#[derive(Arbitrary, Clone, Debug, Eq, Hash, PartialEq)]
@@ -99,7 +100,8 @@ impl Config {
.cranelift_nan_canonicalization(self.wasmtime.canonicalize_nans)
.cranelift_opt_level(self.wasmtime.opt_level.to_wasmtime())
.interruptable(self.wasmtime.interruptable)
.consume_fuel(self.wasmtime.consume_fuel);
.consume_fuel(self.wasmtime.consume_fuel)
.memfd(self.wasmtime.memfd);
// If the wasm-smith-generated module use nan canonicalization then we
// don't need to enable it, but if it doesn't enable it already then we