driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAVH99
----------------------------------------------------------------------
All mmaped pages need to be zapped after resetting to avoid a PUAF. Currently, pages mmaped during reset phase may be left, so avoid mmaping new pages when reset happened.
The complete official user space reset solution is accepted by mainline 6.13. There are certain differences between the current version implementation on OLK-6.6 and mainline 6.13. And these two are KABI incompatible. Considering the openeuler KABI strategy, the mainline patch cannot be directly backport to OLK-6.6. In order to solve some potential problems, this patch merges the mainline patch with the current patch on OLK-6.6 to ensure that the overall solution is basically consistent with the mainline.
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=615...
Fixes: 813b1ee74ff3 ("RDMA/hns: Fix missing resetting notify") Signed-off-by: Chengchang Tang tangchengchang@huawei.com Signed-off-by: Junxian Huang huangjunxian6@hisilicon.com Signed-off-by: Xinghai Cen cenxinghai@h-partners.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index b637424f0a51..1302c58c3937 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -683,6 +683,11 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma) pgprot_t prot; int ret;
+ if (hr_dev->dis_db) { + atomic64_inc(&hr_dev->dfx_cnt[HNS_ROCE_DFX_MMAP_ERR_CNT]); + return -EPERM; + } + rdma_entry = rdma_user_mmap_entry_get_pgoff(uctx, vma->vm_pgoff); if (!rdma_entry) { atomic64_inc(&hr_dev->dfx_cnt[HNS_ROCE_DFX_MMAP_ERR_CNT]); -- 2.33.0
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/12217 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/P...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/12217 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/P...