From nobody Tue Jun 07 06:48:16 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 88EC81BD75B4; Tue, 7 Jun 2022 06:48:17 +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 4LHLXd1Hz0z3pLX; Tue, 7 Jun 2022 06:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654584497; 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=J6JwilvrRlyZXA0UdEFo+BfhPq4rmhmFhdvv6+vKN8Q=; b=J59ftIz+vLQI+YScMgZ/OqQkT5CP3hFgaUWS3N7WBOdlUlvt4AWHjBYkF/Ds7Wyof1xEUZ Y/bSQSzj9DW3uhcOGN4PMU4wd6xgw3PcqNpN90N5zGjb3jCaU+OGiBxckvJUSEnb2dLXlD pOGPz1cv19gHGPwkcGcFVWBcCMIkveHmQDGqZ1uEo01qxnd0VFU8zhci4TBFZff/h+zfeQ HQSLzos6DFVD9sa0yz86U/qhHECQdpsIMTX5QUuF4fxHEgsZoLr8AFDFeZOSPlvKB/M+s1 x3o5agOvU53SnseipFVunnLMthIms5qisr6x719thKRiS42ZA4D6JTJiUSygQw== 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 BF95516146; Tue, 7 Jun 2022 06:48:16 +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 2576mGwg098355; Tue, 7 Jun 2022 06:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2576mGfN098354; Tue, 7 Jun 2022 06:48:16 GMT (envelope-from git) Date: Tue, 7 Jun 2022 06:48:16 GMT Message-Id: <202206070648.2576mGfN098354@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: dad7c072f482 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: dad7c072f482527b4964bbd4b067d06c6df2e592 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654584497; 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=J6JwilvrRlyZXA0UdEFo+BfhPq4rmhmFhdvv6+vKN8Q=; b=Hr9uO8AFDzBL/Y6gQ6ratZsi1j7i4i9Q2IxQIcdt04kbZiaRYEM9UagZ+wcywpENUwYuk+ 9POQ60ro6zNwhCJ0qyi42Ztcyq7qwunCZ2B6F3Sc9S6hKoNNwJA6kXGnEXzU5g0+wKYGf4 eFJnMZW6jjCurmzaIvhynbeplNhLcdUKa/MgjiQqu0X9Yzmcn3bZ6V7duHZL44RohYZMFh f2tKaR0WDUNNMMk6FzizUO7W9LsXvP3+nSpvzFixq1yGHAkKUx1CgsNhYyJGsjUjTzqtN5 esQncovVaomYtWR46H5gCduSFNToTsRxW87vNO7fGeZssPCnsY1ip2vG15Nd1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654584497; a=rsa-sha256; cv=none; b=fPPzScdY0mrXTOSWF0cdnEfAFcww9/hEBF4s/0UoI4bsQN5aMGp0yjSh2VvZAndvy2DYN2 glO25azufHQ/d7zdpSMqWx7MDE7GqJTHyF4Bk+V4gwplA9wmT2WQkGvtVZZmX3PCltBBnm kAQgOHYWguFiOIwDAXz0qx/Cs8laTHX3swTKKJTCPNzx/TzlUBUW2yV4QsOAGe46t28lZv h1Wa0fqPs+QgqAc67wZLSGlnWQrABz/UXfgtBXpbhAqE7V6uXUp5HYnBGW0+nYzRHI2p6r hkyFuS0IqNKFuFMlyr82NSBJ8kApP0lRpXPsYNQ8N11eNl1FZSIWycWebloAEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=dad7c072f482527b4964bbd4b067d06c6df2e592 commit dad7c072f482527b4964bbd4b067d06c6df2e592 Author: Hans Petter Selasky AuthorDate: 2022-05-30 18:19:33 +0000 Commit: Hans Petter Selasky CommitDate: 2022-06-07 06:46:22 +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 28c52c0cb2f2..0d73dee91db6 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cm.c +++ b/sys/ofed/drivers/infiniband/core/ib_cm.c @@ -1104,6 +1104,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);