From c387e8a4ecee76479f4b83b58e2e8ab854ef74ee Mon Sep 17 00:00:00 2001 From: Yuval Shaia Date: Mon, 30 Apr 2018 23:02:20 +0300 Subject: 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 Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum Message-Id: <20180430200223.4119-5-marcel.apfelbaum@gmail.com> --- hw/rdma/rdma_rm_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/rdma/rdma_rm_defs.h') 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 -- cgit v1.2.3