linux/drivers/infiniband/hw/mlx4
Jack Morgenstein c482af646d IB/mlx4: Fix out-of-range array index in destroy qp flow
For non-special QPs, the port value becomes non-zero only at the
RESET-to-INIT transition. If the QP has not undergone that transition,
its port number value is still zero.

If such a QP is destroyed before being moved out of the RESET state,
subtracting one from the qp port number results in a negative value.
Using that negative value as an index into the qp1_proxy array
results in an out-of-bounds array reference.

Fix this by testing that the QP type is one that uses qp1_proxy before
using the port number. For special QPs of all types, the port number is
specified at QP creation time.

Fixes: 9433c18891 ("IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-13 13:39:46 -05:00
..
ah.c IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
alias_GUID.c IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue 2016-10-07 16:54:33 -04:00
cm.c IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order 2015-02-17 22:11:40 -08:00
cq.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
doorbell.c IB: Refactor umem to use linear SG table 2014-03-04 10:34:28 -08:00
Kconfig net: mellanox: add DEVLINK dependencies 2016-03-03 17:08:59 -05:00
mad.c IB/mlx4: Handle well-known-gid in mad_demux processing 2016-11-16 20:04:48 -05:00
main.c IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs 2016-12-13 13:29:46 -05:00
Makefile IB/mlx4: Add iov directory in sysfs under the ib device 2012-09-30 20:33:39 -07:00
mcg.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
mlx4_ib.h IB/core: Let create_ah return extended response to user 2016-12-13 13:38:27 -05:00
mr.c IB/mlx4: Prevent cross page boundary allocation 2016-06-23 10:08:25 -04:00
qp.c IB/mlx4: Fix out-of-range array index in destroy qp flow 2016-12-13 13:39:46 -05:00
srq.c IB/mlx4: Move user vendor structures 2016-10-07 16:54:36 -04:00
sysfs.c IB/mlx4: Forbid using sysfs to change RoCE pkeys 2015-08-30 18:12:22 -04:00