Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-28 Thread Isaku Yamahata
This might be a bit late comment... On Fri, Jul 22, 2011 at 11:05:01AM +0200, Jan Kiszka wrote: diff --git a/hw/pci_host.c b/hw/pci_host.c index 728e2d4..bfdc321 100644 --- a/hw/pci_host.c +++ b/hw/pci_host.c @@ -47,17 +47,33 @@ static inline PCIDevice *pci_dev_find_by_addr(PCIBus *bus,

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-28 Thread Michael S. Tsirkin
On Thu, Jul 28, 2011 at 04:23:24PM +0900, Isaku Yamahata wrote: This might be a bit late comment... On Fri, Jul 22, 2011 at 11:05:01AM +0200, Jan Kiszka wrote: diff --git a/hw/pci_host.c b/hw/pci_host.c index 728e2d4..bfdc321 100644 --- a/hw/pci_host.c +++ b/hw/pci_host.c @@ -47,17

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-28 Thread Isaku Yamahata
On Thu, Jul 28, 2011 at 11:40:21AM +0300, Michael S. Tsirkin wrote: On Thu, Jul 28, 2011 at 04:23:24PM +0900, Isaku Yamahata wrote: This might be a bit late comment... On Fri, Jul 22, 2011 at 11:05:01AM +0200, Jan Kiszka wrote: diff --git a/hw/pci_host.c b/hw/pci_host.c index

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-28 Thread Isaku Yamahata
On Thu, Jul 28, 2011 at 11:40:21AM +0300, Michael S. Tsirkin wrote: I don't see a problem with this, but could you please clarify when does this happen? I think this is only possible for a pci device behind an express root. If so, this belongs in pcie_host.c I'd also like this info to be

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-28 Thread Michael S. Tsirkin
On Fri, Jul 29, 2011 at 10:01:43AM +0900, Isaku Yamahata wrote: On Thu, Jul 28, 2011 at 11:40:21AM +0300, Michael S. Tsirkin wrote: I don't see a problem with this, but could you please clarify when does this happen? I think this is only possible for a pci device behind an express root. If

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-25 Thread Michael S. Tsirkin
On Fri, Jul 22, 2011 at 11:05:01AM +0200, Jan Kiszka wrote: Introduce pci_config_read/write_common helpers to prevent passing accesses down the callback chain that go beyond the config space limits. Adjust length assertions as they are no longer correct (cutting may generate valid 3 byte

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-25 Thread Michael S. Tsirkin
Introduce pci_config_read/write_common helpers to prevent passing accesses down the callback chain that go beyond the config space limits. Adjust length assertions as they are no longer correct (cutting may generate valid 3 byte accesses). Signed-off-by: Jan Kiszka jan.kis...@siemens.com I

Re: [Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-25 Thread Jan Kiszka
On 2011-07-25 17:17, Michael S. Tsirkin wrote: Introduce pci_config_read/write_common helpers to prevent passing accesses down the callback chain that go beyond the config space limits. Adjust length assertions as they are no longer correct (cutting may generate valid 3 byte accesses).

[Qemu-devel] [PATCH v2] pci: Common overflow prevention

2011-07-22 Thread Jan Kiszka
On 2011-07-22 07:32, Michael S. Tsirkin wrote: diff --git a/hw/pcie_host.c b/hw/pcie_host.c index b749865..ed6656b 100644 --- a/hw/pcie_host.c +++ b/hw/pcie_host.c @@ -57,22 +57,22 @@ static void pcie_mmcfg_data_write(PCIBus *s, { PCIDevice *pci_dev = pcie_dev_find_by_mmcfg_addr(s,