diff mbox series

[v6,13/16] fuzz: add an "opaque" to the FuzzTarget struct

Message ID 20201021210922.572955-14-alxndr@bu.edu
State Superseded
Headers show
Series Add a Generic Virtual Device Fuzzer | expand

Commit Message

Alexander Bulekov Oct. 21, 2020, 9:09 p.m. UTC
It can be useful to register FuzzTargets that have nearly-identical
initialization handlers (e.g. for using the same fuzzing code, with
different configuration options). Add an opaque pointer to the
FuzzTarget struct, so that FuzzTargets can hold some data, useful for
storing target-specific configuration options, that can be read by the
get_init_cmdline function.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 tests/qtest/fuzz/fuzz.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Darren Kenny Oct. 22, 2020, 9:14 a.m. UTC | #1
On Wednesday, 2020-10-21 at 17:09:19 -04, Alexander Bulekov wrote:
> It can be useful to register FuzzTargets that have nearly-identical

> initialization handlers (e.g. for using the same fuzzing code, with

> different configuration options). Add an opaque pointer to the

> FuzzTarget struct, so that FuzzTargets can hold some data, useful for

> storing target-specific configuration options, that can be read by the

> get_init_cmdline function.

>

> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>


Reviewed-by: Darren Kenny <darren.kenny@oracle.com>


> ---

>  tests/qtest/fuzz/fuzz.h | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h

> index ed9ce17154..08e9560a79 100644

> --- a/tests/qtest/fuzz/fuzz.h

> +++ b/tests/qtest/fuzz/fuzz.h

> @@ -100,6 +100,7 @@ typedef struct FuzzTarget {

>                         uint8_t *out, size_t max_out_size,

>                         unsigned int seed);

>  

> +    void *opaque;

>  } FuzzTarget;

>  

>  void flush_events(QTestState *);

> -- 

> 2.28.0
diff mbox series

Patch

diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index ed9ce17154..08e9560a79 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -100,6 +100,7 @@  typedef struct FuzzTarget {
                        uint8_t *out, size_t max_out_size,
                        unsigned int seed);
 
+    void *opaque;
 } FuzzTarget;
 
 void flush_events(QTestState *);