| From bippy-1.2.0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@kernel.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2025-22087: bpf: Fix array bounds error with may_goto |
| |
| Description |
| =========== |
| |
| 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. |
| |
| The Linux kernel CVE team has assigned CVE-2025-22087 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.12.23 with commit 19e6817f84000d0b06f09fd69ebd56217842c122 |
| Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.13.11 with commit 4524b7febdd55fb99ae2e1f48db64019fa69e643 |
| Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.14.2 with commit 1a86ae57b2600e5749f5f674e9d4296ac00c69a8 |
| Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.15 with commit 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 |
| |
| Please see https://www.kernel.org for a full list of currently supported |
| kernel versions by the kernel community. |
| |
| Unaffected versions might change over time as fixes are backported to |
| older supported kernel versions. The official CVE entry at |
| https://cve.org/CVERecord/?id=CVE-2025-22087 |
| will be updated if fixes are backported, please check that for the most |
| up to date information about this issue. |
| |
| |
| Affected files |
| ============== |
| |
| The file(s) affected by this issue are: |
| kernel/bpf/core.c |
| kernel/bpf/verifier.c |
| |
| |
| Mitigation |
| ========== |
| |
| The Linux kernel CVE team recommends that you update to the latest |
| stable kernel version for this, and many other bugfixes. Individual |
| changes are never tested alone, but rather are part of a larger kernel |
| release. Cherry-picking individual commits is not recommended or |
| supported by the Linux kernel community at all. If however, updating to |
| the latest release is impossible, the individual changes to resolve this |
| issue can be found at these commits: |
| https://git.kernel.org/stable/c/19e6817f84000d0b06f09fd69ebd56217842c122 |
| https://git.kernel.org/stable/c/4524b7febdd55fb99ae2e1f48db64019fa69e643 |
| https://git.kernel.org/stable/c/1a86ae57b2600e5749f5f674e9d4296ac00c69a8 |
| https://git.kernel.org/stable/c/6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 |