[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.2 3/3] fuzz: fuzz offsets within pio/mmio regions
From: |
Alexander Bulekov |
Subject: |
[PATCH-for-5.2 3/3] fuzz: fuzz offsets within pio/mmio regions |
Date: |
Thu, 29 Oct 2020 13:29:00 -0400 |
The code did not add offsets to FlatRange bases, so we did not fuzz
offsets within device MemoryRegions.
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
tests/qtest/fuzz/generic_fuzz.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
index 31f24ad06f..5770f86be6 100644
--- a/tests/qtest/fuzz/generic_fuzz.c
+++ b/tests/qtest/fuzz/generic_fuzz.c
@@ -298,6 +298,11 @@ static bool get_io_address(address_range *result,
AddressSpace *as,
} while (cb_info.index != index && !cb_info.found);
*result = cb_info.result;
+ if (result->size) {
+ offset = offset % result->size;
+ result->addr += offset;
+ result->size -= offset;
+ }
return cb_info.found;
}
--
2.28.0