[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 43/59] fuzz: Add fuzzing functions for entries of
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks |
Date: |
Mon, 22 Sep 2014 12:42:14 +0100 |
From: Maria Kustova <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Maria Kustova <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/image-fuzzer/qcow2/fuzz.py | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/image-fuzzer/qcow2/fuzz.py b/tests/image-fuzzer/qcow2/fuzz.py
index 404b439..20eba6b 100644
--- a/tests/image-fuzzer/qcow2/fuzz.py
+++ b/tests/image-fuzzer/qcow2/fuzz.py
@@ -18,8 +18,8 @@
import random
-
UINT8 = 0xff
+UINT16 = 0xffff
UINT32 = 0xffffffff
UINT64 = 0xffffffffffffffff
# Most significant bit orders
@@ -28,6 +28,8 @@ UINT64_M = 63
# Fuzz vectors
UINT8_V = [0, 0x10, UINT8/4, UINT8/2 - 1, UINT8/2, UINT8/2 + 1, UINT8 - 1,
UINT8]
+UINT16_V = [0, 0x100, 0x1000, UINT16/4, UINT16/2 - 1, UINT16/2, UINT16/2 + 1,
+ UINT16 - 1, UINT16]
UINT32_V = [0, 0x100, 0x1000, 0x10000, 0x100000, UINT32/4, UINT32/2 - 1,
UINT32/2, UINT32/2 + 1, UINT32 - 1, UINT32]
UINT64_V = UINT32_V + [0x1000000, 0x10000000, 0x100000000, UINT64/4,
@@ -351,3 +353,15 @@ def l2_entry(current):
value = offset + (is_cow << UINT64_M) + \
(is_compressed << UINT64_M - 1) + is_zero
return value
+
+
+def refcount_table_entry(current):
+ """Fuzz an entry of the refcount table."""
+ constraints = UINT64_V
+ return selector(current, constraints)
+
+
+def refcount_block_entry(current):
+ """Fuzz an entry of a refcount block."""
+ constraints = UINT16_V
+ return selector(current, constraints)
--
1.9.3
- [Qemu-devel] [PULL v2 29/59] qapi: Sort BlockdevDriver enum data list, (continued)
- [Qemu-devel] [PULL v2 29/59] qapi: Sort BlockdevDriver enum data list, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 26/59] qdev-monitor: fix segmentation fault on qdev_device_help(), Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 30/59] qapi: Sort items in BlockdevOptions definition, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 31/59] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 35/59] iotests: Add more tests for qcow2 corruption, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 36/59] image-fuzzer: Trivial readability and formatting improvements, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 38/59] qcow2: Fix leak of QemuOpts in qcow2_open(), Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 39/59] qapi: Allow enums in anonymous unions, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 40/59] qcow2: Add overlap-check.template option, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 41/59] qapi/block-core: Add "new" qcow2 options, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 37/59] hmp: fix memory leak at hmp_info_block_jobs(), Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 44/59] layout: Add generators for refcount table and blocks, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 45/59] ahci: Adding basic functionality qtest., Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 42/59] docs: List all image elements currently supported by the fuzzer, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 46/59] ahci: MSI capability should be at 0x80, not 0x50., Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 47/59] ahci: Add test_pci_spec to ahci-test., Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 48/59] ahci: add test_pci_enable to ahci-test., Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 50/59] ahci: Add test_hba_spec to ahci-test., Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 49/59] ahci: properly shadow the TFD register, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 51/59] ahci: Add test_hba_enable to ahci-test., Stefan Hajnoczi, 2014/09/22