From nobody Wed May 22 17:52:33 2024 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 4VkzR60X75z5M740; Wed, 22 May 2024 17:52:34 +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 4VkzR575D1z4nJj; Wed, 22 May 2024 17:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716400354; 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=5IWP8HMB4NpSEzAy3+1yypfsid2N2/hs3d9sbGwcM1Y=; b=N9U9Ca9Q9ZdwALuri3SciUKV+wYLEVP5ZkJ4S7TXlZ4k57YuTohoWvuyClC8NVjUTSAS4q bvYW3eE235TTjYf+w32XN/1iuMvQrVMLcbXo0Dsn0o7UMLYN8HOuNFI2jwLWHcxK0zCVtS VBetYLWX6mCFFC+4WFMTC5O6mKrAcA0LHsRtNqkG7L5n7bcQBK5fhlCaTQc2A6NIcipQf+ 0oWksbeMmxaEUQdmTETpFr8Yy4gzTBIhOIEDRTuVL6fRPv5BNAS9LnT091nYlYXamFS4xn nN15hFFRqBTDFotPz1nUC5GdgQHpAPvv6nweQYrYLvkDEdrVAYCr2iu4LUsElg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716400354; a=rsa-sha256; cv=none; b=P2aNR7RYnt+KKw9B7bLBypCbR5RP07nM9PsvUmpoZs4uLil2PgV9F9SeJJsJyFT59xDhZI oA6f7/sxjJpZfXsU4ntNICMHvnBgFvBKjdQD45Riwkk3p3Dq8by4fpGfrPt8LP3P0OaKb5 i/6wfauh+Lo6pJG5LFPqgQuNI/c8DEXmcpqMfHDMtD9/tMuMfhUNFPXk4Yuy+OKbOJJPCS KpHzxcoFhsW1bFa19AHkwigurPyQjg56pIPq7tqTiTmSHUS0nTSPtqo8QKGJ/qOlcCkKRc vgMzaTGjAfg8gizv2sQliOKHWdLEU2kJDoeLdO4fqAUV0FVILxQSlV41yc3M+w== 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=1716400354; 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=5IWP8HMB4NpSEzAy3+1yypfsid2N2/hs3d9sbGwcM1Y=; b=GKcl7C2YnSgAKlwGfZfjgx3K8JfkZDgjH1/X8HPTgY63kwQEuqr1k1yNQaU+STY2+AFMeq V5Mckw2GfDcC7HEFtH0GFHuTHI67jF/slNU4hKb3b1RGn8xMLes9G81/zq1Gss/YN2ftsi 9TTWpn1waG4cckrk8mjChXUwv9vccGBfRrewaKAX659e96QU7wfhsNiHty2f4zzBYqXVgM x1Uj84KDBB3yd5viloTV3gls7pxZYMlyzshw0yOsoYTDKpoxloulrFYg+zWVrbIgpLiG90 VFavLFOUXmoxbx/b8dsC+SraK1SkGCHrqBHWnqSy6ivLk6PYk2iFRyvanLO0mQ== 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 4VkzR56fh9zFCk; Wed, 22 May 2024 17:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHqXd6059043; Wed, 22 May 2024 17:52:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHqXS1059040; Wed, 22 May 2024 17:52:33 GMT (envelope-from git) Date: Wed, 22 May 2024 17:52:33 GMT Message-Id: <202405221752.44MHqXS1059040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: b0a1a3138a37 - releng/14.1 - fib_dxr: set fib_data field in struct dxr_aux early enough 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b commit b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:50:29 +0000 fib_dxr: set fib_data field in struct dxr_aux early enough Previously it was possible for dxr_build() to return with da->fd unset in case of range_tbl or x_tbl malloc() failures. This may have led to NULL ptr dereferencing in dxr_change_rib_batch(). Approved by: re (cperciva) MFC after: 1 week PR: 278422 (cherry picked from commit 0418d7a0903725ade71ae77c4ff900010a93a185) --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index e7eede53ea51..94f066bdf982 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -877,6 +877,7 @@ dxr_build(struct dxr *dxr) return; dxr->aux = da; da->fibnum = dxr->fibnum; + da->fd = dxr->fd; da->refcnt = 1; LIST_INIT(&da->all_chunks); LIST_INIT(&da->all_trie); @@ -907,7 +908,6 @@ dxr_build(struct dxr *dxr) trie_rebuild = 1; } #endif - da->fd = dxr->fd; microuptime(&t0);