Skip to contentSkip to conversation

xen/pt: Fixup addr validation in xen_pt_pci_config_access_check

PATCH In review Anoob Soman 2 participants 2 messages Jul 5, 2017 – Jul 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/pt: Fixup addr validation in xen_pt_pci_config_access_check

xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid address and should not be ignored.

---
 hw/xen/xen_pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/xen/xen_pt.c +1 -1
index b6d71bb..375efa6 100644
@@ -85,7 +85,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...)
 static int xen_pt_pci_config_access_check(PCIDevice *d, uint32_t addr, int len)
 {
     /* check offset range */
-    if (addr >= 0xFF) {
+    if (addr > 0xFF) {
         XEN_PT_ERR(d, "Failed to access register with offset exceeding 0xFF. "
                    "(addr: 0x%02x, len: %d)\n", addr, len);
         return -1;
Signature · 7 lines
1.8.3.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Anoob Soman

xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid address and should not be ignored.

Quoted 17 lines
---
 hw/xen/xen_pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/xen/xen_pt.c +1 -1
index b6d71bb..375efa6 100644
@@ -85,7 +85,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...)
 static int xen_pt_pci_config_access_check(PCIDevice *d, uint32_t addr, int len)
 {
     /* check offset range */
-    if (addr >= 0xFF) {
+    if (addr > 0xFF) {
         XEN_PT_ERR(d, "Failed to access register with offset exceeding 0xFF. "
                    "(addr: 0x%02x, len: %d)\n", addr, len);
         return -1;
Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel