diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2016-11-27 13:18:19 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-26 07:24:35 (GMT) |
commit | 618d14b01a45cb0fbfe5ad1177699e4a49dec237 (patch) | |
tree | 60cf1f6b833e377cee303e0ff2dda54af139032e /drivers/vfio | |
parent | 970f6806c2b17054ab47cfa0751d8e4150a92c1f (diff) | |
download | linux-618d14b01a45cb0fbfe5ad1177699e4a49dec237.tar.xz |
IB/mlx4: Fix out-of-range array index in destroy qp flow
commit c482af646d0809a8d5e1b7f4398cce3592589b98 upstream.
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: 9433c188915c ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vfio')
0 files changed, 0 insertions, 0 deletions