Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3285704ybb; Tue, 31 Mar 2020 02:06:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtxorn91+qZzP+wpNL5NQXEbs9YVqDlWFx6hqTa4PSELwsK+cwmyuznkJp5EUFziHIyCJzL X-Received: by 2002:a54:4094:: with SMTP id i20mr1283452oii.141.1585645594931; Tue, 31 Mar 2020 02:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645594; cv=none; d=google.com; s=arc-20160816; b=PVoSbsEhKWQea6v+bblcJCPySpooNdcukS9GuBLghF2Ew79SCvRGpADpxAM4HJC86R CeiUqow1H0/S3ujpTp1g+oXxg51LQsSL9WnsUpf6Du8/ppcJZKsCejDR21vAWRT5NbbM p25IiytrNX742LOO071BRolRs7vAUwehJCwZ63IUbz0EQWsfwDxYgrDTdRypyikB8b5Q GGTRzjMyfjtOiF6JSMYKFTZ5buoy+tujIdBcS7BtFJm4ZWSkFshR7lX66c10B1p6HEyk PWEC7746z1xQhHoexLPfK1QRjVt/fmOjr/2RYm+9iWJ1n3jEDZtwXt9zTV6zGzPdtJHM LPcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LYBFjlxZ4L3AaVltYH2Z5quUxDviQhuIWSQQYU28h64=; b=LQT8xy+c2B9GXKkG77z8Xrs/y3K3on6W5NH5mxZAv4HY0gd4njPzCul+sRxYQuT/Ws hrQIHRhSfOtM9siCNfi6I3b7FFYA6R/MjOAsSJsVmpoejGaHASCDHq7XGDNW8zqIrBsP NHrjxXOo0HsV/301hHfJd6kUtIyQ8rY+E0tnReZFnTqbUje98qYTWArzIKjBVHOmrCOZ RxZLdfnkCjaDMTs+6+/YrNBTSbrj0Jf6fZvsfABcWIVw8VSU5uFGmEWEwAZtpWev+eY0 G/HM1pmcj+9ryqQ+RsyUsH/uwLN/h7CJW1IMS2h0zFMhqzxr8FMAsUqwZsIocxoORgc3 TgDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dvPb5AEm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t71si6814079oif.84.2020.03.31.02.06.23; Tue, 31 Mar 2020 02:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dvPb5AEm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730885AbgCaJF5 (ORCPT + 99 others); Tue, 31 Mar 2020 05:05:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:47074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731075AbgCaJFx (ORCPT ); Tue, 31 Mar 2020 05:05:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E11E420675; Tue, 31 Mar 2020 09:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645552; bh=bSQM1Dtvif4FaNcL9hMzSAR+D8lrIbIInjKk3q1hPjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvPb5AEmD/DqgaiKAzeiA61knVoVDmZKStxmVzkY8JMA9K8Pmq28xyQBfgknqOYxk NuVgpdlTIVi5/xZ9pkak5LDOo87TnbCXsZwBhFQNxGSKpCj9QOSDeoEmyNwNNkrAI3 ESMnt3YKlW37+Nmub1Lqa8T1/SfeiOQi6HOK9rWE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Jason Gunthorpe Subject: [PATCH 5.5 088/170] RDMA/odp: Fix leaking the tgid for implicit ODP Date: Tue, 31 Mar 2020 10:58:22 +0200 Message-Id: <20200331085433.639637797@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Gunthorpe commit 0f9826f4753f74f935e18c2a640484ecbd941346 upstream. The tgid used to be part of ib_umem_free_notifier(), when it was reworked it got moved to release, but it should have been unconditional as all umem alloc paths get the tgid. As is, creating an implicit ODP will leak the tgid reference. Link: https://lore.kernel.org/r/20200304181607.GA22412@ziepe.ca Cc: stable@kernel.org Fixes: f25a546e6529 ("RDMA/odp: Use mmu_interval_notifier_insert()") Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/umem_odp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -290,8 +290,8 @@ void ib_umem_odp_release(struct ib_umem_ mmu_interval_notifier_remove(&umem_odp->notifier); kvfree(umem_odp->dma_list); kvfree(umem_odp->page_list); - put_pid(umem_odp->tgid); } + put_pid(umem_odp->tgid); kfree(umem_odp); } EXPORT_SYMBOL(ib_umem_odp_release);