mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-01-13 01:07:34 +00:00
2b2a7d4d76
Add a top level fuzz directory. Other fuzz tests will be added here in subsequent commits. For now fuzzing must be run manually. Soon there will be a way to extract the fuzz artifacts and upload them to cluster fuzz. Change-Id: Iddfb55af78af6f412927b2221f22acb882069d36 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/850851 Reviewed-by: Zach Reizner <zachr@chromium.org>
15 lines
448 B
Rust
15 lines
448 B
Rust
#![no_main]
|
|
#[macro_use] extern crate libfuzzer_sys;
|
|
extern crate kernel_loader;
|
|
extern crate libc;
|
|
extern crate sys_util;
|
|
|
|
use sys_util::{GuestAddress, GuestMemory};
|
|
|
|
use std::io::Cursor;
|
|
|
|
fuzz_target!(|data: &[u8]| { // fuzzed code goes here
|
|
let mut kimage = Cursor::new(data);
|
|
let mem = GuestMemory::new(&[(GuestAddress(0), data.len() + 0x1000)]).unwrap();
|
|
let _ = kernel_loader::load_kernel(&mem, GuestAddress(0), &mut kimage);
|
|
});
|