From nobody Tue Jul 16 15:54:46 2024 X-Original-To: dev-commits-src-branches@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 4WNkCp6NLMz5RWYW; Tue, 16 Jul 2024 15:54:46 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WNkCp5tFlz4Ycl; Tue, 16 Jul 2024 15:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721145286; 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=Mmsw2ykDJ54HnPEDr3cbvYBtv5RlCs6bumVjzjYvtaM=; b=WTWEWOTZ1uYxwOLWGOSafvz0XV6P/525FT8h4/9QHOInHu3Tk+Y1G4VC8jPzPrfx4EIG3q M4N9XxSP5HE9xsnL4RR62Ywb7Pvmn5FGdWnQa8cWg7z5x0SphiQnmEPxZHQZ9KPcXaRvxT dm52+I53MGuJ0JtSFcGaMidaP0OUCl0nDBM+RRovcGRCmtWjPCuupJ54+RUD628/Nclect mEykDwGi0KU698FJ4Lb1XbZVliehbbyszZ91JOftUMglLAnfnBmP3RMZZFX7Qdc+vWmy0C bY8jDQP819e6QVBiQ4NJlnc6koXRsnHWieIG5xPFhKWuDXKafmUd5j91xcM0Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721145286; a=rsa-sha256; cv=none; b=wWl+ia8i/np4oHrRLVE8VnLlPHuBj48DvDfUTie39NZQJjdbubvjUbe1EAZ905+OMugZ9k I04PU/GKfevcvrkYsWIhs+kNnnBPGH1KAb31Ea6yBZa68AmILCsfLTvwOUFbCk63vYXuAZ kKRkZo+aMf+wahdfaN84ZA9dMg22BCK0IldAnJythPrU5wiAsafV7Vs4tCG11dkhDhLV6U 5LSfIMkrzuixqV0R6f1ZL7yXofz4TgFEoRsz6KL6VfR2d/JAHLjFYv1yWHLNiSST4QnX97 ntQ4iXpK7EZX0GA79jOn6N/fbAGB5NjReSwsmBVBW24MJx8qpj0iFzYOTSbxHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721145286; 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=Mmsw2ykDJ54HnPEDr3cbvYBtv5RlCs6bumVjzjYvtaM=; b=sTou3A5x1Za7TnQSiN8iJlEWdJvHXAc9iCGRdi5KliIknHN29ok+hD99PTrLjaEWSfe+aI G+RGylddagF/RgqERMd5sivnrOTvCKD+4nU3JDRWOp9mTvyxb2/cKgRNcNfmzwtxsa4qcH F0dc7fcOyTMZ6xdhhnYu73EIDx06bNxj66iGF4QBJXGfO0PyDKeG3o9SzhR4qvuuH4lJ1T J9dj1hDyu5c1Ma+SRiXmxW/Cxp8S4qKEkwT0DK2cAhE2AY1YBxEUodYzvFaeLHqqmR7Ejw 5v7XjrvCG25kJuQfBPhjtHBCqEe7x3G/8AnVs+buJVvmP94ZoXHO+qKPXV0vKA== 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 4WNkCp5LyjzjXD; Tue, 16 Jul 2024 15:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46GFskK0040875; Tue, 16 Jul 2024 15:54:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46GFskrM040872; Tue, 16 Jul 2024 15:54:46 GMT (envelope-from git) Date: Tue, 16 Jul 2024 15:54:46 GMT Message-Id: <202407161554.46GFskrM040872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a948a61a822f - stable/13 - if_vxlan(4): Move the allocating of statistics counters below if_alloc() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a948a61a822f82a99ac58a412621e5546eac6be3 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a948a61a822f82a99ac58a412621e5546eac6be3 commit a948a61a822f82a99ac58a412621e5546eac6be3 Author: Zhenlei Huang AuthorDate: 2024-07-16 15:53:18 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-16 15:53:18 +0000 if_vxlan(4): Move the allocating of statistics counters below if_alloc() The MFS of the fix [1] is done but the prerequisite [2] has not been MFCed to stable/13 branch yet. This results in another potential leak condition in stable/13 branch. Well `if_alloc(IFT_ETHER)` shall not fail, but just in case. This is a direct commit to stable/13. 1. e729e750806d if_vxlan(4): Plug a memory leak 2. 4787572d0580 ifnet: make if_alloc_domain() never fail Reviewed by: kp Fixes: 12bd1341d2aa if_vxlan(4): Plug a memory leak Differential Revision: https://reviews.freebsd.org/D45972 --- sys/net/if_vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 2cc9f60cba87..3c074952864c 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -3216,13 +3216,13 @@ vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) goto fail; } - vxlan_stats_alloc(sc); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { error = ENOSPC; goto fail; } + vxlan_stats_alloc(sc); sc->vxl_ifp = ifp; rm_init(&sc->vxl_lock, "vxlanrm"); callout_init_rw(&sc->vxl_callout, &sc->vxl_lock, 0);