qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/7] hw/rdma: Fix possible out of bounds access


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 7/7] hw/rdma: Fix possible out of bounds access to port GID index
Date: Mon, 30 Apr 2018 16:14:16 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/30/2018 03:02 PM, Marcel Apfelbaum wrote:
Make sure the backend GID index is less then port's
git table length.

s/git/gid/


Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Yuval Shaia <address@hidden>
---
  hw/rdma/rdma_backend.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
index 5c7b3d8949..e9ced6f9ef 100644
--- a/hw/rdma/rdma_backend.c
+++ b/hw/rdma/rdma_backend.c
@@ -774,7 +774,7 @@ int rdma_backend_init(RdmaBackendDev *backend_dev,
          goto out_destroy_comm_channel;
      }
- if (backend_dev->backend_gid_idx > port_attr.gid_tbl_len) {
+    if (backend_dev->backend_gid_idx >= port_attr.gid_tbl_len) {
          error_setg(errp, "Invalid backend_gid_idx, should be less than %d",
                     port_attr.gid_tbl_len);
          goto out_destroy_comm_channel;


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]