xen/pt: Check if reg->init function sets the 'data' past the reg->size
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 29 Jun 2015 20:41:14 +0000 (16:41 -0400)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 10 Sep 2015 16:47:09 +0000 (16:47 +0000)
commit5b4dd0f55ed3027557ed9a6fd89d5aa379122feb
treeb8dc999483223e499693a5c732f878534db49916
parent2e87512eccf3c5e40f3142ff5a763f4f850839f4
xen/pt: Check if reg->init function sets the 'data' past the reg->size

It should never happen, but in case it does (an developer adds
a new register and the 'init_val' expands past the register
size) we want to report. The code will only write up to
reg->size so there is no runtime danger of the register spilling
across other ones - however to catch this sort of thing
we still return an error.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/xen/xen_pt_config_init.c