Commit ec799ad0 authored by wenglianfa's avatar wenglianfa Committed by Juan Zhou
Browse files

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: default avatarwenglianfa <wenglianfa@huawei.com>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 4c5c7875
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment