Add missing mmput() on error path to avoid ref-count leak.
This problem has already been resolved in mainline by f27a0d50a4bc ("RDMA/umem: Use umem->owning_mm inside ODP").
Fixes: 79bb5b7ee177 ("RDMA/umem: Fix missing mmap_sem in get umem ODP call") Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/infiniband/core/umem_odp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c index eeafdc0beec7..08ef654ea9b8 100644 --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -347,7 +347,8 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem, vma = find_vma(mm, ib_umem_start(umem)); if (!vma || !is_vm_hugetlb_page(vma)) { up_read(&mm->mmap_sem); - return -EINVAL; + ret_val = -EINVAL; + goto out_mm; } h = hstate_vma(vma); umem->page_shift = huge_page_shift(h);
On Fri, Jun 19, 2020 at 04:03:07PM +0000, Yang Yingliang wrote:
Add missing mmput() on error path to avoid ref-count leak.
This problem has already been resolved in mainline by f27a0d50a4bc ("RDMA/umem: Use umem->owning_mm inside ODP").
Fixes: 79bb5b7ee177 ("RDMA/umem: Fix missing mmap_sem in get umem ODP call") Signed-off-by: Yang Yingliang yangyingliang@huawei.com
drivers/infiniband/core/umem_odp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
We need an ack by the owner/maintainer of this code, please get the IB developers/maintainers to do that first.
Any reason why you didn't cc: them also?
thanks,
greg k-h
On 2020/7/13 22:52, Greg KH wrote:
On Fri, Jun 19, 2020 at 04:03:07PM +0000, Yang Yingliang wrote:
Add missing mmput() on error path to avoid ref-count leak.
This problem has already been resolved in mainline by f27a0d50a4bc ("RDMA/umem: Use umem->owning_mm inside ODP").
Fixes: 79bb5b7ee177 ("RDMA/umem: Fix missing mmap_sem in get umem ODP call") Signed-off-by: Yang Yingliang yangyingliang@huawei.com
drivers/infiniband/core/umem_odp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
We need an ack by the owner/maintainer of this code, please get the IB developers/maintainers to do that first.
OK, I will send a new patch.
Any reason why you didn't cc: them also?
thanks,
greg k-h .
linux-stable-mirror@lists.linaro.org