RDMA/hns: Fix Use-After-Free of rsv_qp
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8N7BG ---------------------------------------------------------------------- For the HIP08, the reserved loopback QP is used to release MRs before the MPT is destroyed. After free_mr_exit() and before hns_roce_unregister_device(), rsv_qp is released and set to NULL, and ib_device is not unregister. During this period, the user mode can use ib_device to execute dereg_mr(). As a result, rsv_qp is accessed again and a NULL pointer is reported. To fix Use-After-Free of rsv_qp, execute free_mr_exit() after hns_roce_unregister_device(). Fixes: 6f5f556d ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT") Signed-off-by:wenglianfa <wenglianfa@huawei.com> Signed-off-by:
Juan Zhou <zhoujuan51@h-partners.com>
Loading
Please sign in to comment