diff options
author | Kamenee Arumugam <kamenee.arumugam@intel.com> | 2017-08-22 04:26:32 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-29 02:12:17 +0300 |
commit | 27147273a68ecf5738ef87ccc6cd4bb8883fca84 (patch) | |
tree | aa1fd93479e8eb65efc093fac7a83f9af0e27b33 /drivers/infiniband/hw/qib/qib_mad.c | |
parent | 3b7169338c1caad4d17ed5d9ed412f813c919cd2 (diff) | |
download | linux-27147273a68ecf5738ef87ccc6cd4bb8883fca84.tar.xz |
IB/qib: Stricter bounds checking for copy and array access
Added checking on index value of array 'guids' in qib_ruc.c.
Pass in corrrect size of array for memset operation in qib_mad.c.
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Kamenee Arumugam <kamenee.arumugam@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_mad.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_mad.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c index 549c71971a1f..82d9da9b6997 100644 --- a/drivers/infiniband/hw/qib/qib_mad.c +++ b/drivers/infiniband/hw/qib/qib_mad.c @@ -1573,8 +1573,8 @@ static int pma_get_portcounters_cong(struct ib_pma_mad *pmp, cntrs.port_xmit_packets -= ibp->z_port_xmit_packets; cntrs.port_rcv_packets -= ibp->z_port_rcv_packets; - memset(pmp->reserved, 0, sizeof(pmp->reserved) + - sizeof(pmp->data)); + memset(pmp->reserved, 0, sizeof(pmp->reserved)); + memset(pmp->data, 0, sizeof(pmp->data)); /* * Set top 3 bits to indicate interval in picoseconds in |