Skip to content

Commit 8cbab92

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Doug Ledford: "We had a few more items creep up over the last week. Given we are in -rc8, these are obviously limited to bugs that have a big downside and for which we are certain of the fix. The first is a straight up oops bug that all you have to do is read the code to see it's a guaranteed 100% oops bug. The second is a use-after-free issue. We get away lucky if the queue we are shutting down is empty, but if it isn't, we can end up oopsing. We really need to drain the queue before destroying it. The final one is an issue with bad user input causing us to access our port array out of bounds. While fixing the array out of bounds issue, it was noticed that the original code did the same thing twice (the call to rdma_ah_set_port_num()), so its removal is not balanced by a readd elsewhere, it was already where it needed to be in addition to where it didn't need to be. Summary: - Oops fix in hfi1 driver - use-after-free issue in iser-target - use of user supplied array index without proper checking" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx5: Fix out-of-bound access while querying AH IB/hfi1: Prevent a NULL dereference iser-target: Fix possible use-after-free in connection establishment error
2 parents b45a53b + ae59c3f commit 8cbab92

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/infiniband/hw/hfi1/file_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,11 +763,11 @@ static int complete_subctxt(struct hfi1_filedata *fd)
763763
}
764764

765765
if (ret) {
766-
hfi1_rcd_put(fd->uctxt);
767-
fd->uctxt = NULL;
768766
spin_lock_irqsave(&fd->dd->uctxt_lock, flags);
769767
__clear_bit(fd->subctxt, fd->uctxt->in_use_ctxts);
770768
spin_unlock_irqrestore(&fd->dd->uctxt_lock, flags);
769+
hfi1_rcd_put(fd->uctxt);
770+
fd->uctxt = NULL;
771771
}
772772

773773
return ret;

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,12 +4362,11 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev,
43624362

43634363
memset(ah_attr, 0, sizeof(*ah_attr));
43644364

4365-
ah_attr->type = rdma_ah_find_type(&ibdev->ib_dev, path->port);
4366-
rdma_ah_set_port_num(ah_attr, path->port);
4367-
if (rdma_ah_get_port_num(ah_attr) == 0 ||
4368-
rdma_ah_get_port_num(ah_attr) > MLX5_CAP_GEN(dev, num_ports))
4365+
if (!path->port || path->port > MLX5_CAP_GEN(dev, num_ports))
43694366
return;
43704367

4368+
ah_attr->type = rdma_ah_find_type(&ibdev->ib_dev, path->port);
4369+
43714370
rdma_ah_set_port_num(ah_attr, path->port);
43724371
rdma_ah_set_sl(ah_attr, path->dci_cfi_prio_sl & 0xf);
43734372

drivers/infiniband/ulp/isert/ib_isert.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id)
741741
{
742742
struct isert_conn *isert_conn = cma_id->qp->qp_context;
743743

744+
ib_drain_qp(isert_conn->qp);
744745
list_del_init(&isert_conn->node);
745746
isert_conn->cm_id = NULL;
746747
isert_put_conn(isert_conn);

0 commit comments

Comments
 (0)