Skip to content

Commit f335af1

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "Several bug fixes for old bugs: - Welcome Leon as co-maintainer for RDMA so we are back to having two people - Some corner cases are fixed in mlx5's MR code - Long standing CM bug where a DREQ at the wrong time can result in a long timeout - Missing locking and refcounting in hf1" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/hfi1: Fix use-after-free bug for mm struct IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD RDMA/mlx5: Add a missing update of cache->last_add RDMA/mlx5: Don't remove cache MRs when a delay is needed MAINTAINERS: Update qib and hfi1 related drivers MAINTAINERS: Add Leon Romanovsky to RDMA maintainers
2 parents d017a31 + 2bbac98 commit f335af1

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

MAINTAINERS

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8676,7 +8676,6 @@ F: include/linux/cciss*.h
86768676
F: include/uapi/linux/cciss*.h
86778677

86788678
HFI1 DRIVER
8679-
M: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
86808679
M: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
86818680
L: linux-rdma@vger.kernel.org
86828681
S: Supported
@@ -9599,6 +9598,7 @@ F: drivers/iio/pressure/dps310.c
95999598

96009599
INFINIBAND SUBSYSTEM
96019600
M: Jason Gunthorpe <jgg@nvidia.com>
9601+
M: Leon Romanovsky <leonro@nvidia.com>
96029602
L: linux-rdma@vger.kernel.org
96039603
S: Supported
96049604
W: https://github.com/linux-rdma/rdma-core
@@ -14657,7 +14657,6 @@ F: drivers/rtc/rtc-optee.c
1465714657

1465814658
OPA-VNIC DRIVER
1465914659
M: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
14660-
M: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
1466114660
L: linux-rdma@vger.kernel.org
1466214661
S: Supported
1466314662
F: drivers/infiniband/ulp/opa_vnic
@@ -16099,7 +16098,6 @@ F: include/uapi/linux/qemu_fw_cfg.h
1609916098

1610016099
QIB DRIVER
1610116100
M: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
16102-
M: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
1610316101
L: linux-rdma@vger.kernel.org
1610416102
S: Supported
1610516103
F: drivers/infiniband/hw/qib/
@@ -16617,7 +16615,6 @@ F: drivers/net/ethernet/rdc/r6040.c
1661716615

1661816616
RDMAVT - RDMA verbs software
1661916617
M: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
16620-
M: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
1662116618
L: linux-rdma@vger.kernel.org
1662216619
S: Supported
1662316620
F: drivers/infiniband/sw/rdmavt

drivers/infiniband/core/cm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,15 +2824,14 @@ static int cm_dreq_handler(struct cm_work *work)
28242824
switch (cm_id_priv->id.state) {
28252825
case IB_CM_REP_SENT:
28262826
case IB_CM_DREQ_SENT:
2827+
case IB_CM_MRA_REP_RCVD:
28272828
ib_cancel_mad(cm_id_priv->msg);
28282829
break;
28292830
case IB_CM_ESTABLISHED:
28302831
if (cm_id_priv->id.lap_state == IB_CM_LAP_SENT ||
28312832
cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD)
28322833
ib_cancel_mad(cm_id_priv->msg);
28332834
break;
2834-
case IB_CM_MRA_REP_RCVD:
2835-
break;
28362835
case IB_CM_TIMEWAIT:
28372836
atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES]
28382837
[CM_DREQ_COUNTER]);

drivers/infiniband/hw/hfi1/mmu_rb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler)
8080
unsigned long flags;
8181
struct list_head del_list;
8282

83+
/* Prevent freeing of mm until we are completely finished. */
84+
mmgrab(handler->mn.mm);
85+
8386
/* Unregister first so we don't get any more notifications. */
8487
mmu_notifier_unregister(&handler->mn, handler->mn.mm);
8588

@@ -102,6 +105,9 @@ void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler)
102105

103106
do_remove(handler, &del_list);
104107

108+
/* Now the mm may be freed. */
109+
mmdrop(handler->mn.mm);
110+
105111
kfree(handler);
106112
}
107113

drivers/infiniband/hw/mlx5/mr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,10 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
574574
spin_lock_irq(&ent->lock);
575575
if (ent->disabled)
576576
goto out;
577-
if (need_delay)
577+
if (need_delay) {
578578
queue_delayed_work(cache->wq, &ent->dwork, 300 * HZ);
579+
goto out;
580+
}
579581
remove_cache_mr_locked(ent);
580582
queue_adjust_cache_locked(ent);
581583
}
@@ -625,6 +627,7 @@ static void mlx5_mr_cache_free(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)
625627
{
626628
struct mlx5_cache_ent *ent = mr->cache_ent;
627629

630+
WRITE_ONCE(dev->cache.last_add, jiffies);
628631
spin_lock_irq(&ent->lock);
629632
list_add_tail(&mr->list, &ent->head);
630633
ent->available_mrs++;

drivers/infiniband/sw/rdmavt/qp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3190,7 +3190,11 @@ void rvt_ruc_loopback(struct rvt_qp *sqp)
31903190
spin_lock_irqsave(&sqp->s_lock, flags);
31913191
rvt_send_complete(sqp, wqe, send_status);
31923192
if (sqp->ibqp.qp_type == IB_QPT_RC) {
3193-
int lastwqe = rvt_error_qp(sqp, IB_WC_WR_FLUSH_ERR);
3193+
int lastwqe;
3194+
3195+
spin_lock(&sqp->r_lock);
3196+
lastwqe = rvt_error_qp(sqp, IB_WC_WR_FLUSH_ERR);
3197+
spin_unlock(&sqp->r_lock);
31943198

31953199
sqp->s_flags &= ~RVT_S_BUSY;
31963200
spin_unlock_irqrestore(&sqp->s_lock, flags);

0 commit comments

Comments
 (0)