summary refs log tree commit diff
path: root/fuzz/block_fuzzer.rs
Commit message (Collapse)AuthorAge
* fuzz: add block_size to block_fuzzer constructorDaniel Verkamp2019-12-12
| | | | | | | | | | | | | | | | | | | | Fix the build of block_fuzzer after "devices: block: add block_size option for disks". It might be nice to generate the block size from the random fuzz data, but that would complicate things (we'd have to handle failure of Block::new due to invalid sizes), so let's leave that as a future improvement for now and just use a block_size of 512 to match previous behavior. BUG=chromium:942700 TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: Ia16ef6a57fc8ce4407f8ec9dda0e708302916c4c Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1962535 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* fuzz: block_fuzzer: add sparse param to Block::newDaniel Verkamp2019-11-19
| | | | | | | | | | | | | | | | | | Fix the block_fuzzer build after CL:1906750, which added a new parameter to the Block::new() function without updating the fuzzer. This change passes `true` for sparse in order to keep previous behavior and maximize the available commands for fuzzing. BUG=chromium:1025757 TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: I29ed9945077936aee9636ddee20b59729eb78c85 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1922065 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* devices: virtio: use signal helper for config changesDaniel Verkamp2019-11-18
| | | | | | | | | | | | | | | | Add handling of the virtio device MSI-X configuration change vector by using the signal function that was previously factored out. BUG=chromium:854765 TEST=./build_test TEST=trigger disk config change with `crosvm disk resize ...` Change-Id: I462c23e10d152f896586bb70b95634a53088d480 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898269 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zide Chen <zide.chen@intel.corp-partner.google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* devices: virtio: pass Interrupt to activate()Daniel Verkamp2019-11-18
| | | | | | | | | | | | | | Factor out the common creation of struct Interrupt. No functional change. BUG=chromium:854765 TEST=./build_test Change-Id: Idf8804771ba1af5181818f643e15e1b42918258a Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898268 Tested-by: kokoro <noreply+kokoro@google.com>
* fuzz: convert fuzzers to cros_fuzz frameworkDaniel Verkamp2019-10-28
| | | | | | | | | | | | | This eliminates the boilerplate for catching panics and creating a Rust slice from the fuzzer input data. BUG=None TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: I49666a344b02e3333ad6823bfa7dace08b66b290 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1879495 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* fuzz: block_fuzzer: add msix_config to activateDaniel Verkamp2019-10-25
| | | | | | | | | | | | | | Fix fuzzer build after the VirtioDevice activate() API change requiring the msix_config parameter. BUG=chromium:1017954 TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: I1bd63369e7d112ee55265747a88d64e6545e572a Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1880137 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
* fuzz: remove misleading block fuzzer commentDaniel Verkamp2019-10-24
| | | | | | | | | | | | | | | This looks like it's copied from the qcow fuzzer, and it doesn't apply to the block fuzzer. The actual behavior of the block fuzzer is correctly described by the comment later in the file. BUG=None TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: I9ccd6deba44af8b8df471ee0078ace385696151f Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1853698 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* use `SharedMemory::{named, anon}` to replace `::new`Zach Reizner2019-09-11
| | | | | | | | | | | | | | | | The new constructors are shorter and omit the bare `None` in the `anon` call sites which gave no clues to the reader what the effect of that `None` was. This should improve readability. TEST=./build_test BUG=None Change-Id: I2e34e7df9a4ccc5da50edf4e963a6a42e3d84b22 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1797188 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* fuzz: fix block fuzzer build after block API changeDaniel Verkamp2019-09-03
| | | | | | | | | | | | | | Block::new() now takes a Box of the underlying file; update the block fuzzer accordingly. BUG=chromium:1000065 TEST=`USE='asan fuzzer' emerge-nami crosvm` Change-Id: Ib636e13da5dcd347dd33c40a11508e016ea73b70 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1780336 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* edition: Remove extern crate linesDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rust 2018 edition, `extern crate` is no longer required for importing from other crates. Instead of writing: extern crate dep; use dep::Thing; we write: use dep::Thing; In this approach, macros are imported individually from the declaring crate rather than through #[macro_use]. Before: #[macro_use] extern crate sys_util; After: use sys_util::{debug, error}; The only place that `extern crate` continues to be required is in importing the compiler's proc_macro API into a procedural macro crate. This will hopefully be fixed in a future Rust release. extern crate proc_macro; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293 Reviewed-on: https://chromium-review.googlesource.com/1565302 Commit-Ready: David Tolnay <dtolnay@chromium.org> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* fuzz: Add block device fuzzerDylan Reid2019-03-25
Add the block device fuzzer that interprets the fuzz data input as follows: starting index 8 bytes command location 8 bytes command 16 bytes descriptors circular buffer 16 bytes * 3 Change-Id: I25b58e149bfb9a479fab7955c0ca25c67c590bf6 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/900202 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>