* Patch "IB/mlx4: Fix out-of-range array index in destroy qp flow" has been added to the 4.9-stable tree
@ 2017-01-20 14:29 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-20 14:29 UTC (permalink / raw)
To: jackm, dledford, gregkh, leon; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
IB/mlx4: Fix out-of-range array index in destroy qp flow
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-mlx4-fix-out-of-range-array-index-in-destroy-qp-flow.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From c482af646d0809a8d5e1b7f4398cce3592589b98 Mon Sep 17 00:00:00 2001
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
Date: Sun, 27 Nov 2016 15:18:19 +0200
Subject: IB/mlx4: Fix out-of-range array index in destroy qp flow
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
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>
---
drivers/infiniband/hw/mlx4/qp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1280,7 +1280,8 @@ static int _mlx4_ib_destroy_qp(struct ib
if (is_qp0(dev, mqp))
mlx4_CLOSE_PORT(dev->dev, mqp->port);
- if (dev->qp1_proxy[mqp->port - 1] == mqp) {
+ if (mqp->mlx4_ib_qp_type == MLX4_IB_QPT_PROXY_GSI &&
+ dev->qp1_proxy[mqp->port - 1] == mqp) {
mutex_lock(&dev->qp1_proxy_lock[mqp->port - 1]);
dev->qp1_proxy[mqp->port - 1] = NULL;
mutex_unlock(&dev->qp1_proxy_lock[mqp->port - 1]);
Patches currently in stable-queue which might be from jackm@dev.mellanox.co.il are
queue-4.9/ib-mlx4-handle-well-known-gid-in-mad_demux-processing.patch
queue-4.9/ib-mlx4-fix-out-of-range-array-index-in-destroy-qp-flow.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-20 14:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20 14:29 Patch "IB/mlx4: Fix out-of-range array index in destroy qp flow" has been added to the 4.9-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).