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 30B231A9F85 for ; Sun, 12 Apr 2026 05:36:26 +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=1775972187; cv=none; b=a5i4SZX46iAVxem/IuNfrFJk10IAPIcC10/1nOT/TN2vGBY4nCTxXUKAgTsX3m69RiVj7N0m7QRYteQN/ZhcS7aMLhr82pR9yrc+f75C9kYxBnC71bB/k7an4ZinFdSt97sv0nS7ZCU6r7NRmtEjnQnHh64+cbjkVwF1kOOkqAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775972187; c=relaxed/simple; bh=Jb4xDoeKi27VoFUfHsfbG3lNh0FpDYBs9wcewbupGdg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FgPvQ8z3IIXkFsRm8mlvQ+p8buG+w+oTb5V/gHdNkE6weLOVT+ewqMqzbAEe4REcIGhs6tUP0Yfp4T98sUTM6TvTp+C7U/81QCaHDUZ/kb6y3qAe8A/Lt2TaJ20nsVSk3A277rEXN/7hAdjUyGjWdATzj6ls1ypxK4bLLgPUcjY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TaCD+Nm6; 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="TaCD+Nm6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C37CC19424; Sun, 12 Apr 2026 05:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775972186; bh=Jb4xDoeKi27VoFUfHsfbG3lNh0FpDYBs9wcewbupGdg=; h=From:To:Cc:Subject:Date:Reply-To:From; b=TaCD+Nm6887zxs4af7rj7nxrAsTnS5/R/kPI6f1YjZJVYZhahlikA+qM2finmxZyS 3tziQK9relGQc8UVPAzTeYMAYH/XIBOC6ag6KETGNOdF+Ok82BDmQuwFvVXIwP+PaC /uxSBNuy+Wb8AhSMR7j93DVq4hFrJwv00qrS8d4M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31413: bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR Date: Sun, 12 Apr 2026 07:36:20 +0200 Message-ID: <2026041220-CVE-2026-31413-cce6@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2940; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aG+AnAskDMh4eB9FHfn4ZYAVZOHLRBjsIH76SgrkDVs=; b=owGbwMvMwCRo6H6F97bub03G02pJDJm39UOulEzju/HjRNQn/n2mLNNjDTMPHty2gXPa7GVvz X1KX2RUd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEgk4yLNjWqObs889g5VVm d762c258idJ6UxkWbL/mzxSvsMR3hYPoFcYXrcqx3C8WAQA= 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: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR maybe_fork_scalars() is called for both BPF_AND and BPF_OR when the source operand is a constant. When dst has signed range [-1, 0], it forks the verifier state: the pushed path gets dst = 0, the current path gets dst = -1. For BPF_AND this is correct: 0 & K == 0. For BPF_OR this is wrong: 0 | K == K, not 0. The pushed path therefore tracks dst as 0 when the runtime value is K, producing an exploitable verifier/runtime divergence that allows out-of-bounds map access. Fix this by passing env->insn_idx (instead of env->insn_idx + 1) to push_stack(), so the pushed path re-executes the ALU instruction with dst = 0 and naturally computes the correct result for any opcode. The Linux kernel CVE team has assigned CVE-2026-31413 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12.75 with commit dea9989a3f3961faede93752cd81eb5a9514d911 and fixed in 6.12.80 with commit 342aa1ee995ef5bbf876096dc3a5e51218d76fa4 Issue introduced in 6.18.16 with commit 4c122e8ae14950cf6b59d208fc5160f7c601e746 and fixed in 6.18.21 with commit 58bd87d0e69204dbd739e4387a1edb0c4b1644e7 Issue introduced in 6.19.6 with commit e52567173ba86dbffb990595fbe60e2e83899372 and fixed in 6.19.11 with commit d13281ae7ea8902b21d99d10a2c8caf0bdec0455 Issue introduced in 7.0-rc1 with commit bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7 and fixed in 7.0-rc5 with commit c845894ebd6fb43226b3118d6b017942550910c5 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-2026-31413 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/342aa1ee995ef5bbf876096dc3a5e51218d76fa4 https://git.kernel.org/stable/c/58bd87d0e69204dbd739e4387a1edb0c4b1644e7 https://git.kernel.org/stable/c/d13281ae7ea8902b21d99d10a2c8caf0bdec0455 https://git.kernel.org/stable/c/c845894ebd6fb43226b3118d6b017942550910c5