This is a note to let you know that I've just added the patch titled IB/umem: fix reference count leak in ib_umem_odp_get() to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ib-umem-fix-reference-count-leak-in-ib_umem_odp_get.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From yangyingliang@xxxxxxxxxx Fri Jul 24 11:49:59 2020 From: Yang Yingliang <yangyingliang@xxxxxxxxxx> Date: Tue, 14 Jul 2020 14:56:39 +0000 Subject: IB/umem: fix reference count leak in ib_umem_odp_get() To: <stable@xxxxxxxxxxxxxxx>, <linux-rdma@xxxxxxxxxxxxxxx> Cc: <sashal@xxxxxxxxxx>, <gregkh@xxxxxxxxxxxxxxxxxxx>, <dledford@xxxxxxxxxx>, <jgg@xxxxxxxx>, <hal.rosenstock@xxxxxxxxx>, <yangyingliang@xxxxxxxxxx> Message-ID: <20200714145639.1381719-1-yangyingliang@xxxxxxxxxx> From: Yang Yingliang <yangyingliang@xxxxxxxxxx> Add missing mmput() on error path to avoid ref-count leak. This problem is introduced by 79bb5b7ee177 ("RDMA/umem: Fix missing mmap_sem in get umem ODP call") and resolved by f27a0d50a4bc ("RDMA/umem: Use umem->owning_mm inside ODP"). So, it's only needed in stable-4.14 and stable-4.19. Fixes: 79bb5b7ee177 ("RDMA/umem: Fix missing mmap_sem in get umem ODP call") Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/infiniband/core/umem_odp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -306,7 +306,8 @@ int ib_umem_odp_get(struct ib_ucontext * 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); Patches currently in stable-queue which might be from yangyingliang@xxxxxxxxxx are queue-4.14/ib-umem-fix-reference-count-leak-in-ib_umem_odp_get.patch