]> git.proxmox.com Git - mirror_qemu.git/commit
pseries: Fix RTAS based config access
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 2 Apr 2012 04:17:35 +0000 (14:17 +1000)
committerAndreas Färber <afaerber@suse.de>
Sun, 15 Apr 2012 18:02:09 +0000 (20:02 +0200)
commit92615a5ab96cd2b4981e2aaef40bece6cd7553b6
treed3a7437e69595b1da0e5c8bc2169d1ccd40a88fe
parent45e45ed2d61fb287adf03e49c74c152bfd2c975a
pseries: Fix RTAS based config access

On the pseries platform, access to PCI config space is via RTAS calls(
which go to the hypervisor) rather than MMIO.  This means we don't use
the same code path as nearly everyone else which goes through pci_host.c
and we're missing some of the parameter checking along the way.

We do have some parameter checking in the RTAS calls, but it's not enough.
It checks for overruns, but does not check for unaligned accesses,
oversized accesses (which means the guest could trigger an assertion
failure from pci_host_config_{read,write}_common().  Worse it doesn't do
the basic checking for the number of RTAS arguments and results before
accessing them.

This patch fixes these bugs.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[AF: Fix typos spotted by mst]
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/spapr_pci.c