TencentOS-kernel/drivers/infiniband
Lv Yunlong 7bf4a0f55e RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res
[ Upstream commit 34b39efa5ae82fc0ad0acc27653c12a56328dbbe ]

In bnxt_qplib_alloc_res, it calls bnxt_qplib_alloc_dpi_tbl().  Inside
bnxt_qplib_alloc_dpi_tbl, dpit->dbr_bar_reg_iomem is freed via
pci_iounmap() in unmap_io error branch. After the callee returns err code,
bnxt_qplib_alloc_res calls
bnxt_qplib_free_res()->bnxt_qplib_free_dpi_tbl() in the fail branch. Then
dpit->dbr_bar_reg_iomem is freed in the second time by pci_iounmap().

My patch set dpit->dbr_bar_reg_iomem to NULL after it is freed by
pci_iounmap() in the first time, to avoid the double free.

Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Link: https://lore.kernel.org/r/20210426140614.6722-1-lyl2019@mail.ustc.edu.cn
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:08:01 +08:00
..
core RDMA/addr: Be strict with gid size 2021-05-20 16:07:03 +08:00
hw RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res 2021-05-20 16:08:01 +08:00
sw RDMA/siw: Fix a use after free in siw_alloc_mr 2021-05-20 16:08:01 +08:00
ulp RDMA/srpt: Fix error return code in srpt_cm_req_recv() 2021-05-20 16:07:57 +08:00
Kconfig RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs 2021-03-16 16:41:16 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00