From nobody Tue May 14 20:39: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 4Vf7WT6VhCz5L0J9; Tue, 14 May 2024 20:39:33 +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 4Vf7WT55YDz4Kxb; Tue, 14 May 2024 20:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719173; 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=YI7V/Gwb/zJ8RbkWkMNyKavJk4Y/gQjeYbiIGit/MiQ=; b=sfNCio1AnCjkWH39i8l+eifE2ZE3Qh7UxD6l1tKzfquBzhITx38+LFJh+9XVP2VCn3+QgO hym9b662Ou/BgGq/jAJ5QCHEusBRpTchaftN9HWui2HrXN2zKpghsIm4578Z3sNxCLyt/F 8FMRhULlh67sjX6UOEC3pjx4NK6ip7NFO9dXRJZhm6zE3KY8xNwYA+c0A9u9nYKntcuGia 7burHV6st+HI9ntMnvuCW7R2LobBbQEk8V7W544yJ7TFAFR/OW2RcY8l/HDsnBEry2ZfGv /PSeFqQuW6zK+pQl7MgyaQLyfMyLXe03KkRhBb9vAjcrW1NKuXx13BlqBoH8+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719173; a=rsa-sha256; cv=none; b=glrJ0PL4sZ9QoRj4tLE766hwBFPjSfjsrXbqFWFqCQqHE6YShh89UMm5WVxrO0bm4jtEiM kw2I9YwpD+XM44QXLpAN3RiKsg0VSIyGBeMaXKpsJVhAiyFQImyZxN7d4zV290X1+NmN0a YegrvnEleoTFkg6thSmXvn1KiukjqbtLf9kGoNAN9IlqDziciNdXvgI6nuUXn4vwmFXux+ BsGhcitZ62lkAN6cHsrAQMtkzfy1XOpbTSezGeDZvpXYLMNQ+kMDXZwCwgF60VT/WipVFp IUkJm5XzHMCSzGFO3B+dM36PnmirhBtI7XwzPtCVU8j7tGdf1u4vcFKalR1PqA== 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=1715719173; 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=YI7V/Gwb/zJ8RbkWkMNyKavJk4Y/gQjeYbiIGit/MiQ=; b=hSm6UTC+TQPerQqTlEzcsrV4k9l6/NNLsnUC6iQYcotif+Q2Elf2DcCE1uk5fO2HwNSJcD N0muSWbnXLeP5zaQmtIXjYEOZIAr6QKfL3F8HO+OORPnYza7d/Nk/9idcF/V934z+fAn1k Q49tuD/zbVCsy2Wqbazbf1r7IknI6/TCaxuRn1zlS1iid4LhRbQl9jMK/4aoncYKK2PAwM wchBMugJh41D/oa9QKM9HOUyufvPXA1tbjbgbKSZwxSe+qBhtp1H3DC2jy9sBSWEI4E4iy lLT7U8lpcx/xvWsXtDWPoBQidQ3t1jRE0EIstz+LJ0gq4AEDIibk6zs3j08udQ== 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 4Vf7WT4fRmzmQ7; Tue, 14 May 2024 20:39: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 44EKdXjS093099; Tue, 14 May 2024 20:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKdXsY093096; Tue, 14 May 2024 20:39:33 GMT (envelope-from git) Date: Tue, 14 May 2024 20:39:33 GMT Message-Id: <202405142039.44EKdXsY093096@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: 9ae078121d3f - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ae078121d3f70d8cd8c537fa16daf302ff5ee21 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae078121d3f70d8cd8c537fa16daf302ff5ee21 commit 9ae078121d3f70d8cd8c537fa16daf302ff5ee21 Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:36:20 +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);