From nobody Tue Jun 07 06:45:08 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 218E11BD6198; Tue, 7 Jun 2022 06:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LHLT135v5z3mfN; Tue, 7 Jun 2022 06:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654584309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/z8p3bD/aYkrm4v38qZ96ptxld4L82i011k+zYFOSeU=; b=X+ZGivs7sColFKasESjGEMRcCUOjNxpVKPmvULD6BzU1AocKE2/2Josu+xtK/DOWZvJq7f 2p7jD62r1SRl1WkR/QgRC+y3k2SB6poj4/kHIOENZNrnepME1nnXBNeOEjjmPhO3ckzFJg USUnmgcrJo93HRXMsLrwysxhZQF7jyGvePPHQwSty8QzpSgv1swcf1WGR4t2qO1Tv1qWh7 B+sMeCsdu55Fh3oNsW7zl+gVR/DAZFABRUcK4oP4azfkA9/rm8s6n9zWFTtTmcYkljkMaU oSx+KH0fc3G5o1i0ILGsFlwsYs2sFQbf1Ibtq4NAJlGCRGdAURo+7PE2OTx6IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E30B7162DC; Tue, 7 Jun 2022 06:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2576j8q3097898; Tue, 7 Jun 2022 06:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2576j83q097897; Tue, 7 Jun 2022 06:45:08 GMT (envelope-from git) Date: Tue, 7 Jun 2022 06:45:08 GMT Message-Id: <202206070645.2576j83q097897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 5570397c129d - stable/13 - ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5570397c129d490b909b1962f51376d6742eacf4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654584309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/z8p3bD/aYkrm4v38qZ96ptxld4L82i011k+zYFOSeU=; b=mvM958rgAArxZ8cR2LdV4Q6JmCg93T40SoJGgnzlrurPTXkciU51cdopxWXEpDmGxH/HZs e1FOKerfFC/CZPVDsE8rsSfHACDqDyqFfelDLJpfJs3MPhBRB5VcX56Xix5TZIrn85AyxD Yi6atuNm4SEpGWu7pv+vujadJWvXrpPaJ0caOiNYuP8WyNhlNfRpdR9npht7wva/9Q9BhA TkQ/eSqDdvCUq/rc1rxwHYTb1WtAh+o1t/VyFP0T80QxqwpiEdn438dSCjvXCMM12FkNhy VDUFWdijQWa1Hdq5j6DIN16+It4ItHtHUmmtnK024FmYa2V1BahueDk4NBSS3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654584309; a=rsa-sha256; cv=none; b=DyI6+Lc8gvJoHK1Wwvtp6sls9TjI80t7J94Msj5nLHmf8WBKGpx4kYmqCKyrXTZGhcu+pz 7hlhMgvzDrJAizFprXc9HtQUrWlwadq9bewnMJJoJn3XZpPYYzHzcw5FvntWWnTFWWc4WO U3fWGDUlCKnOuwTvZW5LYMXTXMfQPaPQ95P0ek6sxGNqVUDWMvBkOPwhb+po7xHFbZWzX5 kyXkWNnTM0Oy1fGPnVvBrHJFWKuwwaDi22JKtehDJxAOq1cPcqlLsPAK/4ZzqUa8d12Q4f vOREdVErPBC6UIAEJD3cqvg7ZpZlVbD4fH/Ekms3xhLi3BKvABp8SN3q7kN7cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5570397c129d490b909b1962f51376d6742eacf4 commit 5570397c129d490b909b1962f51376d6742eacf4 Author: Hans Petter Selasky AuthorDate: 2022-05-30 18:19:33 +0000 Commit: Hans Petter Selasky CommitDate: 2022-06-07 06:44:29 +0000 ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen() The algorithm pre-allocates a cm_id since allocation cannot be done while holding the cm.lock spinlock, however it doesn't free it on one error path, leading to a memory leak. Linux commit: c14dfddbd869bf0c2bafb7ef260c41d9cebbcfec PR: 264248 Sponsored by: NVIDIA Networking (cherry picked from commit c4a415505311e30093b6d9ee0493427a66f2b0de) --- sys/ofed/drivers/infiniband/core/ib_cm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_cm.c b/sys/ofed/drivers/infiniband/core/ib_cm.c index 376dcb420f5b..5a486336699b 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cm.c +++ b/sys/ofed/drivers/infiniband/core/ib_cm.c @@ -1179,6 +1179,7 @@ struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device, /* Sharing an ib_cm_id with different handlers is not * supported */ spin_unlock_irqrestore(&cm.lock, flags); + ib_destroy_cm_id(cm_id); return ERR_PTR(-EINVAL); } atomic_inc(&cm_id_priv->refcount);