Message ID | 1543848532-12604-1-git-send-email-lizhijian@cn.fujitsu.com (mailing list archive) |
---|---|
Headers | show |
Series | allow to load initrd below 4G for recent kernel | expand |
On Mon, 3 Dec 2018 at 14:39, Li Zhijian <lizhijian@cn.fujitsu.com> wrote: > > Some address/memory APIs have different type between > 'hwaddr/target_ulong addr' and 'int len'. It is very unsafety, espcially > 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 <pbonzini@redhat.com> > CC: Peter Crosthwaite <crosthwaite.peter@gmail.com> > CC: Richard Henderson <rth@twiddle.net> > CC: Peter Maydell <peter.maydell@linaro.org> > Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM