Enable simd fuzzing on oss-fuzz (#3152)
* Enable simd fuzzing on oss-fuzz This commit generally enables the simd feature while fuzzing, which should affect almost all fuzzers. For fuzzers that just throw random data at the wall and see what sticks, this means that they'll now be able to throw simd-shaped data at the wall and have it stick. For wasm-smith-based fuzzers this commit also updates wasm-smith to 0.6.0 which allows further configuring the `SwarmConfig` after generation, notably allowing `instantiate-swarm` to generate modules using simd using `wasm-smith`. This should much more reliably feed simd-related things into the fuzzers. Finally, this commit updates wasmtime to avoid usage of the general `wasm_smith::Module` generator to instead use a Wasmtime-specific custom default configuration which enables various features we have implemented. * Allow dummy table creation to fail Tables might creation for imports may exceed the memory limit on the store, which we'll want to gracefully recover from and not fail the fuzzers.
This commit is contained in:
@@ -243,7 +243,7 @@ pub fn compile(wasm: &[u8], strategy: Strategy) {
|
||||
/// or aren't enabled for different configs, we should get the same results when
|
||||
/// we call the exported functions for all of our different configs.
|
||||
pub fn differential_execution(
|
||||
module: &wasm_smith::Module,
|
||||
module: &crate::generators::GeneratedModule,
|
||||
configs: &[crate::generators::DifferentialConfig],
|
||||
) {
|
||||
use std::collections::{HashMap, HashSet};
|
||||
@@ -271,7 +271,7 @@ pub fn differential_execution(
|
||||
|
||||
for mut config in configs {
|
||||
// Disable module linking since it isn't enabled by default for
|
||||
// `wasm_smith::Module` but is enabled by default for our fuzz config.
|
||||
// `GeneratedModule` but is enabled by default for our fuzz config.
|
||||
// Since module linking is currently a breaking change this is required
|
||||
// to accept modules that would otherwise be broken by module linking.
|
||||
config.wasm_module_linking(false);
|
||||
@@ -631,7 +631,7 @@ impl wasm_smith::Config for DifferentialWasmiModuleConfig {
|
||||
2
|
||||
}
|
||||
|
||||
fn max_memory_pages(&self) -> u32 {
|
||||
fn max_memory_pages(&self, _is_64: bool) -> u64 {
|
||||
1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user