bpf: Fix array bounds error with may_goto
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix array bounds error with may_goto may_goto uses an additional 8 bytes on the stack, which causes the interpreters[] array to go out of bounds when calculating index by stack_size. 1. If a BPF program is rewritten, re-evaluate the stack size. For non-JIT cases, reject loading directly. 2. For non-JIT cases, calculating interpreters[idx] may still cause out-of-bounds array access, and just warn about it. 3. For jit_requested cases, the execution of bpf_func also needs to be warned. So move the definition of function __bpf_prog_ret0_warn out of the macro definition CONFIG_BPF_JIT_ALWAYS_ON.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.23, 6.13.11, 6.14.2
- CVEs
- CVE-2025-22087
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 23:07 UTC · Revision 1
Source evidence
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix array bounds error with may_goto may_goto uses an additional 8 bytes on the stack, which causes the interpreters[] array to go out of bounds when calculating index by stack_size. 1. If a BPF program is rewritten, re-evaluate the stack size. For non-JIT cases, reject loading directly. 2. For non-JIT cases, calculating interpreters[idx] may still cause out-of-bounds array access, and just warn about it. 3. For jit_requested cases, the execution of bpf_func also needs to be warned. So move the definition of function __bpf_prog_ret0_warn out of the macro definition CONFIG_BPF_JIT_ALWAYS_ON.
osv:CVE-2025-22087
Kernel
Fixed versions: 6.12.23, 6.13.11, 6.14.2
Complete source record
{
"id": "ba86520e0d76da36767f676e2baa6c8a6e0ecbfa1adf6f40122e059f8662f0c7",
"url": "https://osv.dev/vulnerability/CVE-2025-22087",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "bpf: Fix array bounds error with may_goto",
"summary": "In the Linux kernel, the following vulnerability has been resolved: bpf: Fix array bounds error with may_goto may_goto uses an additional 8 bytes on the stack, which causes the interpreters[] array to go out of bounds when calculating index by stack_size. 1. If a BPF program is rewritten, re-evaluate the stack size. For non-JIT cases, reject loading directly. 2. For non-JIT cases, calculating interpreters[idx] may still cause out-of-bounds array access, and just warn about it. 3. For jit_requested cases, the execution of bpf_func also needs to be warned. So move the definition of function __bpf_prog_ret0_warn out of the macro definition CONFIG_BPF_JIT_ALWAYS_ON.",
"evidence": "osv:CVE-2025-22087",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.12.23",
"evidence": "/affected/1/ranges"
},
{
"value": "6.13.11",
"evidence": "/affected/1/ranges"
},
{
"value": "6.14.2",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2025-22087",
"aliases": [
"CVE-2025-22087"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "011832b97b311bb9e3c27945bc0d1089a14209c9"
},
{
"fixed": "19e6817f84000d0b06f09fd69ebd56217842c122"
},
{
"fixed": "4524b7febdd55fb99ae2e1f48db64019fa69e643"
},
{
"fixed": "1a86ae57b2600e5749f5f674e9d4296ac00c69a8"
},
{
"fixed": "6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-22087.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.9.0"
},
{
"fixed": "6.12.23"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.13.11"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.14.0"
},
{
"fixed": "6.14.2"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-22087.json"
}
}
],
"modified": "2026-10-28T02:30:40.400319012Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/19e6817f84000d0b06f09fd69ebd56217842c122",
"https://git.kernel.org/stable/c/1a86ae57b2600e5749f5f674e9d4296ac00c69a8",
"https://git.kernel.org/stable/c/4524b7febdd55fb99ae2e1f48db64019fa69e643",
"https://git.kernel.org/stable/c/6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/22xxx/CVE-2025-22087.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-22087",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/22xxx/CVE-2025-22087.json"
}
},
"related_cves": [
{
"value": "CVE-2025-22087",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 507847,
"published_at": "2025-04-16T14:12:35.359+00:00"
}