[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 43/59] fuzz: Add fuzzing functions for entries of ref
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks |
Date: |
Fri, 19 Sep 2014 15:42:02 +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 32/59] qcow2: Add qcow2_signal_corruption(), (continued)
- [Qemu-devel] [PULL 32/59] qcow2: Add qcow2_signal_corruption(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 33/59] qcow2: Use qcow2_signal_corruption() for overlaps, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 31/59] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 34/59] qcow2: Check L1/L2/reftable entries for alignment, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 35/59] iotests: Add more tests for qcow2 corruption, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 36/59] image-fuzzer: Trivial readability and formatting improvements, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 38/59] qcow2: Fix leak of QemuOpts in qcow2_open(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 39/59] qapi: Allow enums in anonymous unions, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 37/59] hmp: fix memory leak at hmp_info_block_jobs(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 44/59] layout: Add generators for refcount table and blocks, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 46/59] ahci: MSI capability should be at 0x80, not 0x50., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 45/59] ahci: Adding basic functionality qtest., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 47/59] ahci: Add test_pci_spec to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 48/59] ahci: add test_pci_enable to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 49/59] ahci: properly shadow the TFD register, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 50/59] ahci: Add test_hba_spec to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 51/59] ahci: Add test_hba_enable to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 52/59] ahci: Add test_identify case to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 54/59] block: delete cow block driver, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 55/59] block: vhdx - fix reading beyond pointer during image creation, Stefan Hajnoczi, 2014/09/19