[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/16] fuzz: Add PCI features to the general fuzzer
From: |
Alexander Bulekov |
Subject: |
Re: [PATCH v3 03/16] fuzz: Add PCI features to the general fuzzer |
Date: |
Mon, 21 Sep 2020 10:41:39 -0400 |
On 200921 0744, Philippe Mathieu-Daudé wrote:
> On 9/21/20 4:24 AM, Alexander Bulekov wrote:
> > This patch compares TYPE_PCI_DEVICE objects against the user-provided
> > matching pattern. If there is a match, we use some hacks and leverage
> > QOS to map each possible BAR for that device. Now fuzzed inputs might be
> > converted to pci_read/write commands which target specific. This means
> > that we can fuzz a particular device's PCI configuration space,
> >
> > Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> > Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> > ---
> > tests/qtest/fuzz/general_fuzz.c | 81 +++++++++++++++++++++++++++++++++
> > 1 file changed, 81 insertions(+)
> >
> > diff --git a/tests/qtest/fuzz/general_fuzz.c
> > b/tests/qtest/fuzz/general_fuzz.c
> > index bf75b215ca..7c4c1398a7 100644
> > --- a/tests/qtest/fuzz/general_fuzz.c
> > +++ b/tests/qtest/fuzz/general_fuzz.c
> > @@ -24,6 +24,7 @@
> > #include "exec/ramblock.h"
> > #include "exec/address-spaces.h"
> > #include "hw/qdev-core.h"
> > +#include "hw/pci/pci.h"
> >
> > /*
> > * SEPARATOR is used to separate "operations" in the fuzz input
> > @@ -35,12 +36,17 @@ enum cmds {
> > OP_OUT,
> > OP_READ,
> > OP_WRITE,
> > + OP_PCI_READ,
> > + OP_PCI_WRITE,
> > OP_CLOCK_STEP,
> > };
>
> As there is no versioning, does adding new commands
> invalidates the corpus?
>
> [...]
>
Yes. I think there are a few approaches:
1.) Write a separate OP parser/converter in python that will convert the
corpus to a newer version. Each time we change the code:
a. write a converter
b. download corpus from oss-fuzz
c. convert the corpus
d. commit new corpus to the seed corpus repo (we don't have one
right now)
2.) Same as (1) but instead of corpus_v1 -> corpus_v2,
try to convert corpus_v1 -> qtest commands -> corpus_v2
3.) Use 1st byte to pick corpus format version. I think this could lead
to a lot of code-bloat and could hurt fuzzing performance (fuzzer
mutations could make new inputs that still use old corpus versions)...
4.) Do nothing and wait..
Do you have any suggestion?
-Alex
- [PATCH v3 00/16] Add a General Virtual Device Fuzzer, Alexander Bulekov, 2020/09/20
- [PATCH v3 01/16] memory: Add FlatView foreach function, Alexander Bulekov, 2020/09/20
- [PATCH v3 03/16] fuzz: Add PCI features to the general fuzzer, Alexander Bulekov, 2020/09/20
- [PATCH v3 02/16] fuzz: Add general virtual-device fuzzer, Alexander Bulekov, 2020/09/20
- [PATCH v3 04/16] fuzz: Add DMA support to the generic-fuzzer, Alexander Bulekov, 2020/09/20
- [PATCH v3 06/16] fuzz: Add fuzzer callbacks to DMA-read functions, Alexander Bulekov, 2020/09/20
- [PATCH v3 05/16] fuzz: Declare DMA Read callback function, Alexander Bulekov, 2020/09/20
- [PATCH v3 08/16] fuzz: add a DISABLE_PCI op to general-fuzzer, Alexander Bulekov, 2020/09/20
- [PATCH v3 07/16] fuzz: Add support for custom crossover functions, Alexander Bulekov, 2020/09/20
- [PATCH v3 09/16] fuzz: add a crossover function to generic-fuzzer, Alexander Bulekov, 2020/09/20