CVE-2026-31413 (GCVE-0-2026-31413)
Vulnerability from cvelistv5 – Published: 2026-04-12 05:36 – Updated: 2026-04-12 05:36
VLAI?
Title
bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR
Summary
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.
Severity ?
No CVSS data available.
Assigner
References
Impacted products
| Vendor | Product | Version | ||
|---|---|---|---|---|
| Linux | Linux |
Affected:
dea9989a3f3961faede93752cd81eb5a9514d911 , < 342aa1ee995ef5bbf876096dc3a5e51218d76fa4
(git)
Affected: 4c122e8ae14950cf6b59d208fc5160f7c601e746 , < 58bd87d0e69204dbd739e4387a1edb0c4b1644e7 (git) Affected: e52567173ba86dbffb990595fbe60e2e83899372 , < d13281ae7ea8902b21d99d10a2c8caf0bdec0455 (git) Affected: bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7 , < c845894ebd6fb43226b3118d6b017942550910c5 (git) |
||
{
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"kernel/bpf/verifier.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "342aa1ee995ef5bbf876096dc3a5e51218d76fa4",
"status": "affected",
"version": "dea9989a3f3961faede93752cd81eb5a9514d911",
"versionType": "git"
},
{
"lessThan": "58bd87d0e69204dbd739e4387a1edb0c4b1644e7",
"status": "affected",
"version": "4c122e8ae14950cf6b59d208fc5160f7c601e746",
"versionType": "git"
},
{
"lessThan": "d13281ae7ea8902b21d99d10a2c8caf0bdec0455",
"status": "affected",
"version": "e52567173ba86dbffb990595fbe60e2e83899372",
"versionType": "git"
},
{
"lessThan": "c845894ebd6fb43226b3118d6b017942550910c5",
"status": "affected",
"version": "bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"kernel/bpf/verifier.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "7.0-rc1"
},
{
"lessThan": "7.0-rc1",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.12.*",
"status": "unaffected",
"version": "6.12.80",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.18.*",
"status": "unaffected",
"version": "6.18.21",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.19.*",
"status": "unaffected",
"version": "6.19.11",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "7.0-rc5",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.12.80",
"versionStartIncluding": "6.12.75",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.18.21",
"versionStartIncluding": "6.18.16",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.19.11",
"versionStartIncluding": "6.19.6",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "7.0-rc5",
"versionStartIncluding": "7.0-rc1",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR\n\nmaybe_fork_scalars() is called for both BPF_AND and BPF_OR when the\nsource operand is a constant. When dst has signed range [-1, 0], it\nforks the verifier state: the pushed path gets dst = 0, the current\npath gets dst = -1.\n\nFor BPF_AND this is correct: 0 \u0026 K == 0.\nFor BPF_OR this is wrong: 0 | K == K, not 0.\n\nThe pushed path therefore tracks dst as 0 when the runtime value is K,\nproducing an exploitable verifier/runtime divergence that allows\nout-of-bounds map access.\n\nFix this by passing env-\u003einsn_idx (instead of env-\u003einsn_idx + 1) to\npush_stack(), so the pushed path re-executes the ALU instruction with\ndst = 0 and naturally computes the correct result for any opcode."
}
],
"providerMetadata": {
"dateUpdated": "2026-04-12T05:36:14.632Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/342aa1ee995ef5bbf876096dc3a5e51218d76fa4"
},
{
"url": "https://git.kernel.org/stable/c/58bd87d0e69204dbd739e4387a1edb0c4b1644e7"
},
{
"url": "https://git.kernel.org/stable/c/d13281ae7ea8902b21d99d10a2c8caf0bdec0455"
},
{
"url": "https://git.kernel.org/stable/c/c845894ebd6fb43226b3118d6b017942550910c5"
}
],
"title": "bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2026-31413",
"datePublished": "2026-04-12T05:36:14.632Z",
"dateReserved": "2026-03-09T15:48:24.087Z",
"dateUpdated": "2026-04-12T05:36:14.632Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"nvd": "{\"cve\":{\"id\":\"CVE-2026-31413\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2026-04-12T06:16:20.050\",\"lastModified\":\"2026-04-12T06:16:20.050\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR\\n\\nmaybe_fork_scalars() is called for both BPF_AND and BPF_OR when the\\nsource operand is a constant. When dst has signed range [-1, 0], it\\nforks the verifier state: the pushed path gets dst = 0, the current\\npath gets dst = -1.\\n\\nFor BPF_AND this is correct: 0 \u0026 K == 0.\\nFor BPF_OR this is wrong: 0 | K == K, not 0.\\n\\nThe pushed path therefore tracks dst as 0 when the runtime value is K,\\nproducing an exploitable verifier/runtime divergence that allows\\nout-of-bounds map access.\\n\\nFix this by passing env-\u003einsn_idx (instead of env-\u003einsn_idx + 1) to\\npush_stack(), so the pushed path re-executes the ALU instruction with\\ndst = 0 and naturally computes the correct result for any opcode.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/342aa1ee995ef5bbf876096dc3a5e51218d76fa4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/58bd87d0e69204dbd739e4387a1edb0c4b1644e7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c845894ebd6fb43226b3118d6b017942550910c5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d13281ae7ea8902b21d99d10a2c8caf0bdec0455\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…