highbank: validate register offset before access
commitc5c752af8cddad3e4e51acef40a46db998638144
authorPrasad J Pandit <pjp@fedoraproject.org>
Mon, 13 Nov 2017 13:55:24 +0000 (13 13:55 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Nov 2017 13:55:24 +0000 (13 13:55 +0000)
tree8cba183ec03c10a6d07a73dbfbdc08c767c708f9
parent5ca66278c859bb1ded243755aeead2be6992ce73
highbank: validate register offset before access

An 'offset' parameter sent to highbank register r/w functions
could be greater than number(NUM_REGS=0x200) of hb registers,
leading to an OOB access issue. Add check to avoid it.

Reported-by: Moguofang (Dennis mo) <moguofang@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20171113062658.9697-1-ppandit@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/highbank.c