ppc/pnv: check size before data buffer access
authorPrasad J Pandit <pjp@fedoraproject.org>
Fri, 26 Oct 2018 12:33:58 +0000 (18:03 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 8 Nov 2018 01:04:40 +0000 (12:04 +1100)
commitd07945e78eb6b593cd17a4640c1fc9eb35e3245d
treeeac18888eac783c1f679505842d400166ba4b78e
parentb8edea50a7b8fba52ec3d8222f09991bea8add85
ppc/pnv: check size before data buffer access

While performing PowerNV memory r/w operations, the access length
'sz' could exceed the data[4] buffer size. Add check to avoid OOB
access.

Reported-by: Moguofang <moguofang@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: C├ędric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/pnv_lpc.c