CVE-2026-31413
bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR
Reported by linux · Published April 12, 2026
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.
EPSS 0.23% · 13.9th percentile
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel6.18-modules-extra-common | Amazon Linux | 1:6.18.25-52.107.amzn2023 |
| kernel6.12-modules-extra | Amazon Linux | 1:6.12.80-105.147.amzn2023 |
| kernel6.18-headers | Amazon Linux | 1:6.18.25-52.107.amzn2023 |
| kernel6.18-tools | Amazon Linux | 1:6.18.25-52.107.amzn2023 |
| kernel6.12-libbpf-static | Amazon Linux | 1:6.12.80-105.147.amzn2023 |
| kernel6.12-modules-extra-common | Amazon Linux | 1:6.12.80-105.147.amzn2023 |
| kernel6.18-tools-devel | Amazon Linux | 1:6.18.25-52.107.amzn2023 |
| kernel6.12-tools | Amazon Linux | 1:6.12.80-105.147.amzn2023 |
| kernel6.12 | Amazon Linux | 1:6.12.80-105.147.amzn2023 |
| Linux | Linux | d13281ae7ea8902b21d99d10a2c8caf0bdec0455, 58bd87d0e69204dbd739e4387a1edb0c4b1644e7, 342aa1ee995ef5bbf876096dc3a5e51218d76fa4 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | dea9989a3f3961faede93752cd81eb5a9514d911, 4c122e8ae14950cf6b59d208fc5160f7c601e746, e52567173ba86dbffb990595fbe60e2e83899372 |
| Linux | Linux | 6.12.75, 6.18.16, 6.19.6 |
| amazon:2023 | kernel6.18-modules-extra-common | 0 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| amazon:2023 | kernel6.18-headers | 0 |
| amazon:2023 | kernel6.18-tools | 0 |
| amazon:2023 | kernel6.12-libbpf-static | 0 |
| amazon:2023 | kernel6.12-modules-extra-common | 0 |
| amazon:2023 | kernel6.18-tools-devel | 0 |
| amazon:2023 | kernel6.12-tools | 0 |
| amazon:2023 | kernel6.12 | 0 |
| amazon:2023 | python3-perf6.18 | 0 |
| amazon:2023 | perf6.12 | 0 |
| amazon:2023 | kernel6.12-libbpf | 0 |
| amazon:2023 | kernel6.18 | 0 |
| amazon:2023 | kernel-livepatch-6.12.80-105.147 | 0 |
| amazon:2023 | kernel-livepatch-6.18.25-52.107 | 0 |
| amazon:2023 | kernel6.12-headers | 0 |
| amazon:2023 | python3-perf6.12 | 0 |
| amazon:2023 | kernel6.12-tools-devel | 0 |
…and 9 more
Timeline
- Apr 12, 2026 CVE Published
- Apr 12, 2026 PoC Published (5 in total, the first dated here)
- Apr 12, 2026 Security Advisory (10 in total, the first dated here)
- Apr 27, 2026 CVE Updated
- May 18, 2026 EPSS Score (30 in total, the first dated here)
- Jun 29, 2026 Coalition ESS Score
- Aug 11, 2026 Distribution Patch (9 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-31413
vulnetix vdb fixes CVE-2026-31413
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-31413/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart