From d18a530d8589257cd81960284df8730ef869cabe Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Mon, 30 Apr 2018 23:02:23 +0300 Subject: hw/rdma: Fix possible out of bounds access to port GID index Make sure the backend GID index is less then port's gid table length. Signed-off-by: Marcel Apfelbaum Reviewed-by: Yuval Shaia Message-Id: <20180430200223.4119-8-marcel.apfelbaum@gmail.com> --- hw/rdma/rdma_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/rdma/rdma_backend.c') 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; -- cgit v1.2.3