lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2399c7f2-61bf-de85-28dc-ad8fe89ea671@hisilicon.com>
Date:   Sat, 24 Dec 2022 09:22:36 +0800
From:   "xuhaoyue (A)" <xuhaoyue1@...ilicon.com>
To:     Miaoqian Lin <linmq006@...il.com>,
        Wenpeng Liang <liangwenpeng@...wei.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Leon Romanovsky <leon@...nel.org>,
        Yixing Liu <liuyixing1@...wei.com>,
        <linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] RDMA/hns: Fix refcount leak in hns_roce_mmap

On 2022/12/23 15:29:00, Miaoqian Lin wrote:
> rdma_user_mmap_entry_get_pgoff() takes the reference.
> Add missing rdma_user_mmap_entry_put() to release the reference.
> 
> Fixes: 0045e0d3f42e ("RDMA/hns: Support direct wqe of userspace")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> change in v2:
> - use goto label to manage the release.
> ---
>  drivers/infiniband/hw/hns/hns_roce_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
> index 8ba68ac12388..946ba1109e87 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_main.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
> @@ -443,14 +443,15 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
>  		prot = pgprot_device(vma->vm_page_prot);
>  		break;
>  	default:
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto out;
>  	}
>  
>  	ret = rdma_user_mmap_io(uctx, vma, pfn, rdma_entry->npages * PAGE_SIZE,
>  				prot, rdma_entry);
>  
> +out:
>  	rdma_user_mmap_entry_put(rdma_entry);
> -
>  	return ret;
>  }
>  
> 

Thank you. For the patch:
Acked-by Haoyue Xu <xuhaoyue1@...ilicon.com>

Regards,
Haoyue

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ