Skip to content

Commit 0f84f4f

Browse files
committed
RDMA/irdma: Fix a window for use-after-free
jira VULN-70168 cve CVE-2022-50137 commit-author Mustafa Ismail <mustafa.ismail@intel.com> commit 8ecef78 During a destroy CQ an interrupt may cause processing of a CQE after CQ resources are freed by irdma_cq_free_rsrc(). Fix this by moving the call to irdma_cq_free_rsrc() after the irdma_sc_cleanup_ceqes(), which is called under the cq_lock. Fixes: b48c24c ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20220705230815.265-6-shiraz.saleem@intel.com Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> (cherry picked from commit 8ecef78) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent a857843 commit 0f84f4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,11 +1774,11 @@ static int irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata)
17741774
spin_unlock_irqrestore(&iwcq->lock, flags);
17751775

17761776
irdma_cq_wq_destroy(iwdev->rf, cq);
1777-
irdma_cq_free_rsrc(iwdev->rf, iwcq);
17781777

17791778
spin_lock_irqsave(&iwceq->ce_lock, flags);
17801779
irdma_sc_cleanup_ceqes(cq, ceq);
17811780
spin_unlock_irqrestore(&iwceq->ce_lock, flags);
1781+
irdma_cq_free_rsrc(iwdev->rf, iwcq);
17821782

17831783
return 0;
17841784
}

0 commit comments

Comments
 (0)