mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
fuzz: update virtqueue fuzzer for new VolatileSlice API
BUG=chromium:1087578 TEST=emerge-amd64-generic crosvm Change-Id: Ia206abf03f95ca92f5944fb8efc23d3f8355e292 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2220731 Tested-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
de1f2c59ab
commit
ec9a99146e
1 changed files with 3 additions and 2 deletions
|
@ -8,7 +8,6 @@ use std::mem::size_of;
|
|||
|
||||
use cros_fuzz::fuzz_target;
|
||||
use cros_fuzz::rand::FuzzRng;
|
||||
use data_model::VolatileMemory;
|
||||
use devices::virtio::{DescriptorChain, Queue};
|
||||
use rand::{Rng, RngCore};
|
||||
use sys_util::{GuestAddress, GuestMemory};
|
||||
|
@ -71,7 +70,9 @@ fuzz_target!(|data: &[u8]| {
|
|||
}
|
||||
|
||||
// First zero out all of the memory.
|
||||
let vs = mem.get_slice(0, MEM_SIZE).unwrap();
|
||||
let vs = mem
|
||||
.get_slice_at_addr(GuestAddress(0), MEM_SIZE as usize)
|
||||
.unwrap();
|
||||
vs.write_bytes(0);
|
||||
|
||||
// Fill in the descriptor table.
|
||||
|
|
Loading…
Reference in a new issue