]> xenbits.xensource.com Git - qemu-xen-traditional.git/commit
MSI-X: avoid array overrun upon MSI-X table writes xen-4.6.1
authorJan Beulich <jbeulich@suse.com>
Mon, 4 Jan 2016 15:34:29 +0000 (15:34 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 4 Jan 2016 15:35:42 +0000 (15:35 +0000)
commit7457f4beae2583a106a4176949514e81248fc22d
tree416e85d951db58d5fe7c1d8a601f1fc9b997aa9a
parent6ff95ee25149052f6eccfd5d3b3ec814f4f8a6d7
MSI-X: avoid array overrun upon MSI-X table writes

pt_msix_init() allocates msix->msix_entry[] to just cover
msix->total_entries entries. While pci_msix_readl() resorts to reading
physical memory for out of bounds reads, pci_msix_writel() so far
simply accessed/corrupted unrelated memory.

pt_iomem_map()'s call to cpu_register_physical_memory() registers a
page granular region, which is necessary as the Pending Bit Array may
share space with the MSI-X table (but nothing else is allowed to). This
also explains why pci_msix_readl() actually honors out of bounds reads,
but pci_msi_writel() doesn't need to.

This is XSA-164.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
(cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
hw/pt-msi.c