mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-24 00:18:36 -07: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
|
|
@ -2832,6 +2832,7 @@ MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr,
|
|||
stn_he_p(buf, l, val);
|
||||
} else {
|
||||
/* RAM case */
|
||||
fuzz_dma_read_cb(addr, len, mr, false);
|
||||
ram_ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l, false);
|
||||
memcpy(buf, ram_ptr, l);
|
||||
}
|
||||
|
|
@ -3192,6 +3193,7 @@ void *address_space_map(AddressSpace *as,
|
|||
memory_region_ref(mr);
|
||||
*plen = flatview_extend_translation(fv, addr, len, mr, xlat,
|
||||
l, is_write, attrs);
|
||||
fuzz_dma_read_cb(addr, *plen, mr, is_write);
|
||||
ptr = qemu_ram_ptr_length(mr->ram_block, xlat, plen, true);
|
||||
|
||||
return ptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue