CVE-2026-31413: bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR
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.
Security readout for executives and security teams
Plain-English summary
A Linux kernel BPF verifier mistake can approve behavior that differs from what the processor actually executes. A local attacker with low privileges may use that mismatch to access memory outside a BPF map’s bounds, threatening system confidentiality, integrity, and availability.
Executive priority
Prioritize assessment and patching because successful local exploitation could compromise all three security objectives. Focus first on multi-user or otherwise locally accessible Linux systems. Exact exposure cannot be determined from the supplied version data alone, so require vendor-confirmed affected-build mapping before closing findings.
Technical view
For BPF_OR with a constant operand and destination range [-1, 0], maybe_fork_scalars() incorrectly models the forked zero path as remaining zero, although 0 | K equals K. This verifier/runtime divergence permits out-of-bounds map access. The fix makes the pushed path re-execute the ALU instruction at the current instruction index.
Likely exposure
Potential exposure includes Linux hosts running an affected kernel where a low-privileged actor can reach BPF program loading. The bundle does not define exact vulnerable ranges, configuration prerequisites, or distribution backports. Its listed versions and hashes are marked defaultStatus unaffected, so version-only matching is insufficient; consult distribution or vendor mappings.
Exploitation context
The kernel description explicitly calls the verifier/runtime divergence exploitable and says it allows out-of-bounds map access. CVSS characterizes exploitation as local, low complexity, low privilege, and requiring no user interaction. The CVE is not listed as KEV, and the supplied sources provide no evidence of active exploitation.
Researcher notes
The source establishes an unsound verifier state fork for BPF_OR and identifies instruction re-execution as the correction. No CWE is assigned. The supplied affected data is insufficient for definitive vulnerable-version boundaries and marks its listed entries defaultStatus unaffected. No exploit sample, configuration prerequisite, distribution mapping, or in-the-wild activity is documented.
Mitigation direction
Apply a vendor-supported kernel update containing the applicable referenced stable fix.
Check Linux distribution advisories for affected build and backport mappings.
Prioritize shared systems where low-privileged accounts or services can load BPF programs.
Use vendor-recommended restrictions as temporary mitigation if an update cannot be applied promptly.
Validation and detection
Inventory running kernel versions and distribution build identifiers across Linux hosts.
Check vendor changelogs or kernel source trees for the applicable referenced fix commit.
Identify low-privileged accounts or services permitted to load BPF programs.
Confirm remediated kernels are running after required restart procedures.
Run relevant vendor or kernel BPF verifier regression tests after updating.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31413 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.