CVE-2026-31413

Source
https://cve.org/CVERecord?id=CVE-2026-31413
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31413.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-31413
Downstream
Published
2026-04-12T05:36:14.632Z
Modified
2026-04-14T05:03:16.621921Z
Summary
bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR
Details

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix unsound scalar forking in maybeforkscalars() for BPF_OR

maybeforkscalars() is called for both BPFAND and BPFOR 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 BPFAND this is correct: 0 & K == 0. For BPFOR 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->insnidx (instead of env->insnidx + 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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31413.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
dea9989a3f3961faede93752cd81eb5a9514d911
Fixed
342aa1ee995ef5bbf876096dc3a5e51218d76fa4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4c122e8ae14950cf6b59d208fc5160f7c601e746
Fixed
58bd87d0e69204dbd739e4387a1edb0c4b1644e7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e52567173ba86dbffb990595fbe60e2e83899372
Fixed
d13281ae7ea8902b21d99d10a2c8caf0bdec0455
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7
Fixed
c845894ebd6fb43226b3118d6b017942550910c5

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31413.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.75
Fixed
6.12.80
Type
ECOSYSTEM
Events
Introduced
6.18.16
Fixed
6.18.21
Type
ECOSYSTEM
Events
Introduced
6.19.6
Fixed
6.19.11

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31413.json"