mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 04:43:54 -06:00
fuzz: Add fuzzer callbacks to DMA-read functions
We should be careful to not call any functions besides fuzz_dma_read_cb. Without --enable-fuzzing, fuzz_dma_read_cb is an empty inlined function. Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Message-Id: <20201023150746.107063-7-alxndr@bu.edu> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
e7d3222e2e
commit
a3c20e91de
5 changed files with 11 additions and 0 deletions
|
@ -2462,6 +2462,7 @@ address_space_read_cached(MemoryRegionCache *cache, hwaddr addr,
|
|||
void *buf, hwaddr len)
|
||||
{
|
||||
assert(addr < cache->len && len <= cache->len - addr);
|
||||
fuzz_dma_read_cb(cache->xlat + addr, len, cache->mrs.mr, false);
|
||||
if (likely(cache->ptr)) {
|
||||
memcpy(buf, cache->ptr + addr, len);
|
||||
return MEMTX_OK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue