Jan Beulich
2012-Jun-25 10:50 UTC
[PATCH] qemu-traditional/passthrough: fix off-by-one in PCI config space register index check
Register 255 (0xff) is still valid to be accessed.
Reported-by: Rolu <rolu@roce.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -1538,7 +1538,7 @@ static void pt_pci_write_config(PCIDevic
#endif
/* check offset range */
- if (address >= 0xFF)
+ if (address > 0xFF)
{
PT_LOG_DEV(d, "Error: Failed to write register with offset
exceeding FFh. "
"[Offset:%02xh][Length:%d]\n", address, len);
@@ -1714,7 +1714,7 @@ static uint32_t pt_pci_read_config(PCIDe
int ret = 0;
/* check offset range */
- if (address >= 0xFF)
+ if (address > 0xFF)
{
PT_LOG_DEV(d, "Error: Failed to read register with offset
exceeding FFh. "
"[Offset:%02xh][Length:%d]\n", address, len);
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Ian Jackson
2012-Jun-29 16:07 UTC
Re: [PATCH] qemu-traditional/passthrough: fix off-by-one in PCI config space register index check
Jan Beulich writes ("[Xen-devel] [PATCH] qemu-traditional/passthrough: fix
off-by-one in PCI config space register index
check"):> Register 255 (0xff) is still valid to be accessed.
>
> Reported-by: Rolu <rolu@roce.org>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Looks reasonable to me.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>