From nobody Tue May 07 15:50:31 2024 X-Original-To: dev-commits-src-main@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 4VYjRC2h4hz5J5Z5; Tue, 07 May 2024 15:50:31 +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 4VYjRC2DnMz4Nb8; Tue, 7 May 2024 15:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715097031; 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=O7lrYqhtvWFuY6XT80L+Suvse2kQaUg+nqqcvW2WPVI=; b=urQXmr6i65DUxoew3c+68ZDcKF6tq953VkxmLEf4O1Ni8n8nZUxkp73PLm5sY/jzO5KGyt GyijU8kreLaba0xD2yenCoS2rqW2qv4mZMcIXG3bL2Gi27UECy0ypf3eicr5otpukZyItX k5ultRusRA1tthDNDN9+JzmzQyVM/4X92+oGJ3AzZ806LTqsZpW66tuuni4SgjopmDZMMK st7J789pa1W89KTIlcUim5f+XfmJliDKv2G2tP8wE8tQZN46EvhAm8XBA0eqY0dBmYd2Le JUdXOiIEMsxv+mfm0Gk+oSfU7LSUBKNwRY+D43Cp7ySP86NMkb2oMqUTHniL/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715097031; a=rsa-sha256; cv=none; b=WtOgsCFP/kzJXAISmREGtSMLWO7M0YmqLqlH5AeZ4qEbmr6vNHzKx3qDkVDzi3wxwShd1g gmIHU16v0QlssgrHP/ABimpd2S1Dfifi9stsw/jmuskjXI9XGPjJbmMtuSg4QKUJAIuEAe f88Ef7jcUtUYn1zj+n4No//PHVaM/B9oHSgPtLRUbW7fi0BWUOXKaU124sPkmf+V3/06Gf NNm+BR6NsNtNlOofvkVOYY9cDQC5Aa2296ZigYhawXuQt7Ww14dKVeBYPk+g2J1WoI1aQ0 vorkhqwTyjasKVDpKdZ3zVtNYFVkxjurwJidqEitAziPT8RW7OwUt+rUYNFRAA== 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=1715097031; 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=O7lrYqhtvWFuY6XT80L+Suvse2kQaUg+nqqcvW2WPVI=; b=wgiHhDJTLm58OWOqlA2M+doOtbeleqK8qctQO2bOw0SbAom/lA8cx7wLuG8CHkZzxiZD02 SlLZEFJi7HeCkroBMLMv1SKYi5yoUPp+CEm+DaAZ9py67ZdFrx2gqhobjTUy9AX7nsq4e1 XkePNxz/rEvZJ+6drnJb/E1uJZR+TEMnSiIMyr04InFRxV+Mz9pfdhfRUjR9vsy/VTusRd L/MOJ0Pepu/mTKEtkeN0EEgdbj/uNo0dvrxwWxpm7MK6hSgZq7haK3CPCk7D2Bre+8kMI2 7Uy9H8chBsb1M08imvvqqw75HawHjA0cH0forhbllzED2obyflMsUy2PVXmzoA== 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 4VYjRC1rmmzn43; Tue, 7 May 2024 15:50:31 +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 447FoVPI024217; Tue, 7 May 2024 15:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 447FoVgo024214; Tue, 7 May 2024 15:50:31 GMT (envelope-from git) Date: Tue, 7 May 2024 15:50:31 GMT Message-Id: <202405071550.447FoVgo024214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: b24e353f9e58 - main - fib_dxr: set fib_data field in struct dxr_aux early enough List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b24e353f9e58f6b5bcbd444a062c1c57cd8fc43d Auto-Submitted: auto-generated The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=b24e353f9e58f6b5bcbd444a062c1c57cd8fc43d commit b24e353f9e58f6b5bcbd444a062c1c57cd8fc43d Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-07 15:44:09 +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(). MFC after: 1 week PR: 278422 --- 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 91f3bafdb47d..82245ecf6e66 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -882,6 +882,7 @@ dxr_build(struct dxr *dxr) } dxr->aux = da; da->fibnum = dxr->fibnum; + da->fd = dxr->fd; da->refcnt = 1; LIST_INIT(&da->all_chunks); LIST_INIT(&da->all_trie); @@ -918,7 +919,6 @@ dxr_build(struct dxr *dxr) trie_rebuild = 1; } #endif - da->fd = dxr->fd; microuptime(&t0);