summaryrefslogtreecommitdiffstats
path: root/hw/rdma/rdma_rm_defs.h
diff options
context:
space:
mode:
authorYuval Shaia2018-04-30 22:02:20 +0200
committerMarcel Apfelbaum2018-05-03 19:52:29 +0200
commitc387e8a4ecee76479f4b83b58e2e8ab854ef74ee (patch)
treebcbebea63cdb7999efc51c5a57823d88c99c1fd5 /hw/rdma/rdma_rm_defs.h
parenthw/rdma: Delete port's pkey table (diff)
downloadqemu-c387e8a4ecee76479f4b83b58e2e8ab854ef74ee.tar.gz
qemu-c387e8a4ecee76479f4b83b58e2e8ab854ef74ee.tar.xz
qemu-c387e8a4ecee76479f4b83b58e2e8ab854ef74ee.zip
hw/rdma: Fix possible out of bounds access to GID table
Array size is MAX_PORT_GIDS, let's make sure the given index is in range. While there limit device table size to 1. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Message-Id: <20180430200223.4119-5-marcel.apfelbaum@gmail.com>
Diffstat (limited to 'hw/rdma/rdma_rm_defs.h')
-rw-r--r--hw/rdma/rdma_rm_defs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
index 45503f14e0..4d22a20e4c 100644
--- a/hw/rdma/rdma_rm_defs.h
+++ b/hw/rdma/rdma_rm_defs.h
@@ -20,9 +20,9 @@
#define MAX_PORTS 1
#define MAX_PORT_GIDS 1
+#define MAX_GIDS MAX_PORT_GIDS
#define MAX_PORT_PKEYS 1
#define MAX_PKEYS MAX_PORT_PKEYS
-#define MAX_GIDS 2048
#define MAX_UCS 512
#define MAX_MR_SIZE (1UL << 27)
#define MAX_QP 1024