aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorAlexander Bulekov <alxndr@bu.edu>2020-10-29 13:29:00 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-11-03 13:17:27 -0500
commit953e6d7c0e94126dbfdb63ba1546e6b74ed9ccee (patch)
tree4440815bb16f1599dac038ff89fb9bfe26956e3d /tests/qtest
parentcc3d99c7418925b9f252482d67055e7c3f2c4814 (diff)
downloadqemu-953e6d7c0e94126dbfdb63ba1546e6b74ed9ccee.zip
qemu-953e6d7c0e94126dbfdb63ba1546e6b74ed9ccee.tar.gz
qemu-953e6d7c0e94126dbfdb63ba1546e6b74ed9ccee.tar.bz2
fuzz: fuzz offsets within pio/mmio regions
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> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Message-Id: <20201029172901.534442-4-alxndr@bu.edu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/fuzz/generic_fuzz.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
index 3a5dbc3..262a963 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;
}