[Qemu-devel] [PATCH] xen/pt: Fixup addr validation in xen_pt_pci_config_access_check

Anoob Soman posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1499262995-11621-1-git-send-email-anoob.soman@citrix.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/xen/xen_pt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] xen/pt: Fixup addr validation in xen_pt_pci_config_access_check
Posted by Anoob Soman 6 years, 9 months ago
xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid
address and should not be ignored.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
---
 hw/xen/xen_pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index b6d71bb..375efa6 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -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;
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] xen/pt: Fixup addr validation in xen_pt_pci_config_access_check
Posted by Anthony PERARD 6 years, 9 months ago
On Wed, Jul 05, 2017 at 02:56:35PM +0100, Anoob Soman wrote:
> xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid
> address and should not be ignored.
> 
> Signed-off-by: Anoob Soman <anoob.soman@citrix.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

> ---
>  hw/xen/xen_pt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index b6d71bb..375efa6 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -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;

-- 
Anthony PERARD