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 <marcel.apfelbaum@gmail.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Message-Id: <20180430200223.4119-8-marcel.apfelbaum@gmail.com>
This commit is contained in:
parent
6c080b9ea6
commit
d18a530d85
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user