From nobody Tue May 14 20:38:58 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 4Vf7Vp5GCDz5Kyw3; Tue, 14 May 2024 20:38:58 +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 4Vf7Vp2V2Fz4JrR; Tue, 14 May 2024 20:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719138; 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=srNxVVUtikiiVBJrneDOPu/cgIMrFk0AZnFaKds+qcc=; b=tPkSI0sLedwSRV6FmCe5dcQctRZ2i3MPoX/Eh3liNLoLLhOREscGI1VWGeNs/zH7uSyayL Hj3OLL8aED3mD2vq/PW4tM8ePOOIX7lsv8YIFeT+E54ZgnrE9xeA9CCaM6b6mtV8ATPKLK hWY+BUneHUYfh7jCL8a44XVfptNqUW82lZdLJbAs4teVSx4rR+0qnoNpNX3qL3nVj4BSV+ LxT5zVw5zY3QEPsYpel365tVlPk8yKdnnZW2BqSc877v8XXJ7qNGG7eJZWHRg1lXJ0J3Eh NPUJ6WYhOsG3+krcAFqB4v3tgdCCWgP7joR3d1z1/vETJPX5p1jY/E8xE+Gepg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719138; a=rsa-sha256; cv=none; b=qiyxNUS8fuVsiYdKjSMJWq5x6xD1YAMwk6iZGDD8qRTksGdEg7UNvzN7WYMFmVNvIbpyhT OyXHltWza4JwVVj5XJ8PzfAoxQzFSM621G8pjTTkAzO93irtUGucm4w5ZyqtAUBkW8Dd0n tD1sinjgOuq5vxOLMy8nPrlmjtNIpsKTYe+HcYIIf/G4FudqrELdOHnvgEoCG7pvZFF169 FzJdhNmJbivrJpkilxRXSwo/CTbhPq9xuiizBA+KSDd9PFCpP+1WRYtFp5uW3vmxX6DHvU /mpca7TRza9GoM+Z1Sg9IsRznobHGIJqMGtStX5WbwHHEfoMsEdRMEnmm7WKvQ== 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=1715719138; 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=srNxVVUtikiiVBJrneDOPu/cgIMrFk0AZnFaKds+qcc=; b=tmLLdHkueuihNj+4LAuGdbH7FPJYggplIV9Nd6VfSLDUYlpq0I9dRAT8uGhaisYZfq0Tc3 knKvQ1qbqwgd0Ya4hMEwVIy4tmWrlNz8ykhlg9HXRdFtE/zWtMDsp8nwUOjR9EoTjM1QuQ GVaMvACEAlxzZXLH54lXKKft2uFzmELoTkTOdFDqtySQutL+ortps5f1s4KNbg70ZmRElc WT+aPenRoPJHkOrroVcofnGuyhBdiZ4RwxzqeZ6QlrJ55H/ZKCtbR0gBbQ+ET4SSJZoYVs QcQ6nNPJpvmOX4WBD0ivadyr+0VSuT+GRBdR+5Iviz+WAgClQvVDx4KQZGwDUw== 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 4Vf7Vp26G7zmZS; Tue, 14 May 2024 20:38:58 +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 44EKcwb6092526; Tue, 14 May 2024 20:38:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EKcwkQ092523; Tue, 14 May 2024 20:38:58 GMT (envelope-from git) Date: Tue, 14 May 2024 20:38:58 GMT Message-Id: <202405142038.44EKcwkQ092523@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: 0418d7a09037 - stable/14 - fib_dxr: set fib_data field in struct dxr_aux early enough 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: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0418d7a0903725ade71ae77c4ff900010a93a185 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=0418d7a0903725ade71ae77c4ff900010a93a185 commit 0418d7a0903725ade71ae77c4ff900010a93a185 Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-14 20:32:41 +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);