OSDN Git Service

hw/pci-host/bonito: Avoid buffer overrun for bad LDMA/COP accesses
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Jul 2015 15:33:42 +0000 (16:33 +0100)
committerLeon Alrae <leon.alrae@imgtec.com>
Thu, 13 Aug 2015 15:22:53 +0000 (16:22 +0100)
commit58d479786b11a7e982419c1e0905b8490ef9a787
tree459c19694ea1d9b3ca3dea7b5352f28f05aaa447
parenteb02cc3f89013612cb05df23b5441741e902bbd2
hw/pci-host/bonito: Avoid buffer overrun for bad LDMA/COP accesses

The LDMA and COP memory regions represent four 32 bit registers
each, but the memory regions themselves are 0x100 bytes large.
Add guards to the read and write accessors so that bogus accesses
beyond the four defined registers don't just run off the end of
the bonldma and boncop structs and into whatever lies beyond.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
hw/pci-host/bonito.c