]> Git Repo - qemu.git/commit
unify len and addr type for memory/address APIs
authorLi Zhijian <[email protected]>
Thu, 17 Jan 2019 12:49:01 +0000 (20:49 +0800)
committerPaolo Bonzini <[email protected]>
Tue, 5 Feb 2019 15:50:18 +0000 (16:50 +0100)
commit0c249ff71c094c0e009e2ccaef5237af3610b0fb
tree855e1f40abe9e930f66749b83ab3a2831992c546
parentb86d01ba47cfe3fc7505924ca2804f370383ad97
unify len and addr type for memory/address APIs

Some address/memory APIs have different type between
'hwaddr/target_ulong addr' and 'int len'. It is very unsafe, especially
some APIs will be passed a non-int len by caller which might cause
overflow quietly.
Below is an potential overflow case:
    dma_memory_read(uint32_t len)
      -> dma_memory_rw(uint32_t len)
        -> dma_memory_rw_relaxed(uint32_t len)
          -> address_space_rw(int len) # len overflow

CC: Paolo Bonzini <[email protected]>
CC: Peter Crosthwaite <[email protected]>
CC: Richard Henderson <[email protected]>
CC: Peter Maydell <[email protected]>
CC: Stefano Garzarella <[email protected]>
Signed-off-by: Li Zhijian <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
exec.c
include/exec/cpu-all.h
include/exec/cpu-common.h
include/exec/memory.h
This page took 0.026735 seconds and 4 git commands to generate.