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