linux/drivers/infiniband
Chengchang Tang 330c825e66 RDMA/hns: Fix UAF for cq async event
[ Upstream commit a942ec2745 ]

The refcount of CQ is not protected by locks. When CQ asynchronous
events and CQ destruction are concurrent, CQ may have been released,
which will cause UAF.

Use the xa_lock() to protect the CQ refcount.

Fixes: 9a4435375c ("IB/hns: Add driver files for hns RoCE driver")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240412091616.370789-6-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-10-17 15:11:58 +02:00
..
core RDMA/mad: Improve handling of timed out WRs of mad agent 2024-10-17 15:11:50 +02:00
hw RDMA/hns: Fix UAF for cq async event 2024-10-17 15:11:58 +02:00
sw RDMA/rxe: Fix seg fault in rxe_comp_queue_pkt 2024-10-17 15:11:53 +02:00
ulp RDMA/rtrs-srv: Avoid null pointer deref during path establishment 2024-10-17 15:11:51 +02:00
Kconfig RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00