From: Stefan Hajnoczi <stefanha@gmail.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: qemu-devel@nongnu.org, f4bug@amsat.org, darren.kenny@oracle.com,
bsd@redhat.com, dstepanov.src@gmail.com, stefanha@redhat.com
Subject: Re: [RFC PATCH 0/3] fuzz: add generic fuzzer
Date: Tue, 23 Jun 2020 15:16:01 +0100 [thread overview]
Message-ID: <20200623141601.GL36568@stefanha-x1.localdomain> (raw)
In-Reply-To: <20200611055651.13784-1-alxndr@bu.edu>
[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]
On Thu, Jun 11, 2020 at 01:56:48AM -0400, Alexander Bulekov wrote:
> These patches add a generic fuzzer for virtual devices. This should
> allow us to fuzz devices that accept inputs over MMIO, PIO and DMA
> without any device-specific code.
>
> Example:
> QEMU_FUZZ_ARGS="-device virtio-net" \
> FUZZ_REGION_WHITELIST="virtio pci-" \
> ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=general-pci-enum-fuzz
>
> The above command will add a virtio-net device to the QEMU arguments and
> restrict the fuzzer to only interact with MMIO and PIO regions with
> names that contain "virtio" or "pci-". I find these names using the info
> mtree monitor command.
>
> Basically, the fuzzer splits the input into a series of commands, such
> as mmio_write, pio_write, etc. Additionally, these patches add "hooks"
> to functions that are typically used by virtual-devices to read from RAM
> (DMA). These hooks attempt to populate these DMA regions with fuzzed
> data, just in time. There are some differences from my reference code
> that seem to result in performance issues that I am still trying to iron
> out. I also need to figure out how to add the DMA "hooks" in a neat way.
> Maybe I can use -Wl,--wrap for this. I appreciate any feedback.
>
> Alexander Bulekov (3):
> fuzz: add a general fuzzer for any qemu arguments
> fuzz: add support for fuzzing DMA regions
> fuzz: Add callbacks for dma-access functions
>
> exec.c | 17 +-
> include/exec/memory.h | 8 +
> include/exec/memory_ldst_cached.inc.h | 9 +
> include/sysemu/dma.h | 5 +-
> memory_ldst.inc.c | 12 +
> tests/qtest/fuzz/Makefile.include | 1 +
> tests/qtest/fuzz/general_fuzz.c | 556 ++++++++++++++++++++++++++
> 7 files changed, 606 insertions(+), 2 deletions(-)
> create mode 100644 tests/qtest/fuzz/general_fuzz.c
CCing Dima in case he is interested in this generic fuzzing approach.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-06-23 14:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 5:56 [RFC PATCH 0/3] fuzz: add generic fuzzer Alexander Bulekov
2020-06-11 5:56 ` [RFC PATCH 1/3] fuzz: add a general fuzzer for any qemu arguments Alexander Bulekov
2020-06-11 5:56 ` [RFC PATCH 2/3] fuzz: add support for fuzzing DMA regions Alexander Bulekov
2020-06-11 5:56 ` [RFC PATCH 3/3] fuzz: Add callbacks for dma-access functions Alexander Bulekov
2020-06-23 14:14 ` Stefan Hajnoczi
2020-06-23 14:55 ` Alexander Bulekov
2020-06-26 15:44 ` Stefan Hajnoczi
2020-07-09 23:48 ` Alexander Bulekov
2020-07-13 11:41 ` Stefan Hajnoczi
2020-07-13 11:52 ` Alexander Bulekov
2020-06-24 9:46 ` Philippe Mathieu-Daudé
2020-06-11 6:55 ` [RFC PATCH 0/3] fuzz: add generic fuzzer no-reply
2020-06-23 14:16 ` Stefan Hajnoczi [this message]
2020-06-25 15:30 ` Dima Stepanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200623141601.GL36568@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=alxndr@bu.edu \
--cc=bsd@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=dstepanov.src@gmail.com \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).