Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79081303A1E for ; Wed, 12 Nov 2025 10:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762943073; cv=none; b=j7Iz7aqPoaLy2UPVwP+tECivGYcvWJj9DSAiDeUuzIsN3EbK1g0+Edvv/EP3pBPpp3fXCA5ic0SJ2ZtnFArjwqKWrPxBOuvg8dz0vLdSgMTeAHrQOYBHJUbsVxVmVuWo090qD5Yaw4Qs43HluokRmWtdhU7HzsZbEVxcPtj3HcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762943073; c=relaxed/simple; bh=K0gPCyyVHlSHTjYTYFgaRdnUbEKj6AOR7WugNflkyRk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tT+piUbyIlHcw8uoIKdxERCQKTgq635i8ad4wJTKN21xOKOA1LFpYOtC+nrEaxsPrrXaMnqtNounrP9lrTL0Ge9MYYqEe3oneO/BLCzdi3dVSxLenF276ScIqr1Eftpn9SfjvsMMpL37B6eeYCYVb+eahxNeEameqpZg7Lpo8k4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Yl7hKwnn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Yl7hKwnn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DCB3C19421; Wed, 12 Nov 2025 10:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762943073; bh=K0gPCyyVHlSHTjYTYFgaRdnUbEKj6AOR7WugNflkyRk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Yl7hKwnntgXYqOQsYihSUD23yfu1vPdXJ3gVvo4GhVaiF87ogqY89HV8jstKUV+t3 /ft2qaBljDTv6k55CyZEmjee4DSHF1CrM28tUZHjVaNDU4GOYrYJRnIGfy0QJKOQla yPPNxW5I3bRYn4bplFzQvkWGdyjppn/cYmjtGvIg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40143: bpf: dont report verifier bug for missing bpf_scc_visit on speculative path Date: Wed, 12 Nov 2025 19:24:19 +0900 Message-ID: <2025111256-CVE-2025-40143-a4ce@gregkh> X-Mailer: git-send-email 2.51.2 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3107; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=77WP2JWqi9Zclq3GIcr68ZrU8GmZL2gkAk2HxmpempE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkiCTbreBr+Z/OvkT9bmSOSssxEZ4fVApbPfIqzczr/b YzI2yLXEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOx7mSY73l4ic/B1zmh89wN GE6KNIqE2hQrMsyPPby91vxC9Sn5PpXb0/6Vn0sMP/oNAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: bpf: dont report verifier bug for missing bpf_scc_visit on speculative path Syzbot generated a program that triggers a verifier_bug() call in maybe_exit_scc(). maybe_exit_scc() assumes that, when called for a state with insn_idx in some SCC, there should be an instance of struct bpf_scc_visit allocated for that SCC. Turns out the assumption does not hold for speculative execution paths. See example in the next patch. maybe_scc_exit() is called from update_branch_counts() for states that reach branch count of zero, meaning that path exploration for a particular path is finished. Path exploration can finish in one of three ways: a. Verification error is found. In this case, update_branch_counts() is called only for non-speculative paths. b. Top level BPF_EXIT is reached. Such instructions are never a part of an SCC, so compute_scc_callchain() in maybe_scc_exit() will return false, and maybe_scc_exit() will return early. c. A checkpoint is reached and matched. Checkpoints are created by is_state_visited(), which calls maybe_enter_scc(), which allocates bpf_scc_visit instances for checkpoints within SCCs. Hence, for non-speculative symbolic execution paths, the assumption still holds: if maybe_scc_exit() is called for a state within an SCC, bpf_scc_visit instance must exist. This patch removes the verifier_bug() call for speculative paths. The Linux kernel CVE team has assigned CVE-2025-40143 to this issue. Affected and fixed versions =========================== Issue introduced in 6.17 with commit c9e31900b54cadf5398dfb838c0a63effa1defec and fixed in 6.17.3 with commit 3861e7c4324aa20a632fb74eb3904114f6afdb57 Issue introduced in 6.17 with commit c9e31900b54cadf5398dfb838c0a63effa1defec and fixed in 6.18-rc1 with commit a3c73d629ea1373af3c0c954d41fd1af555492e3 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-40143 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/bpf/verifier.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/3861e7c4324aa20a632fb74eb3904114f6afdb57 https://git.kernel.org/stable/c/a3c73d629ea1373af3c0c954d41fd1af555492e3