| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2024-35905: bpf: Protect against int overflow for stack access size |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| bpf: Protect against int overflow for stack access size |
| |
| This patch re-introduces protection against the size of access to stack |
| memory being negative; the access size can appear negative as a result |
| of overflowing its signed int representation. This should not actually |
| happen, as there are other protections along the way, but we should |
| protect against it anyway. One code path was missing such protections |
| (fixed in the previous patch in the series), causing out-of-bounds array |
| accesses in check_stack_range_initialized(). This patch causes the |
| verification of a program with such a non-sensical access size to fail. |
| |
| This check used to exist in a more indirect way, but was inadvertendly |
| removed in a833a17aeac7. |
| |
| The Linux kernel CVE team has assigned CVE-2024-35905 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 5.10.209 with commit afea95d319ccb4ad2060dece9ac5e2e364dec543 and fixed in 5.10.215 with commit 9970e059af471478455f9534e8c3db82f8c5496d |
| Issue introduced in 5.15.148 with commit 02962684258eb53f414a8a59854767be526e6abb and fixed in 5.15.154 with commit 37dc1718dc0c4392dbfcb9adec22a776e745dd69 |
| Issue introduced in 6.1.75 with commit b1d4d54d32ce6342f5faffe71bae736540ce7cb5 and fixed in 6.1.85 with commit 98cdac206b112bec63852e94802791e316acc2c1 |
| Issue introduced in 6.6.14 with commit 08b91babccbb168353f8d43fea0ed28a4cad568c and fixed in 6.6.26 with commit 3f0784b2f1eb9147973d8c43ba085c5fdf44ff69 |
| Issue introduced in 6.8 with commit a833a17aeac73b33f79433d7cee68d5cafd71e4f and fixed in 6.8.5 with commit 203a68151e8eeb331d4a64ab78303f3a15faf103 |
| Issue introduced in 6.8 with commit a833a17aeac73b33f79433d7cee68d5cafd71e4f and fixed in 6.9 with commit ecc6a2101840177e57c925c102d2d29f260d37c8 |
| Issue introduced in 6.7.2 with commit 1858b8a331937f3976d8482cd5f6e1f945294ad3 |
| |
| 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-2024-35905 |
| 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/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/9970e059af471478455f9534e8c3db82f8c5496d |
| https://git.kernel.org/stable/c/37dc1718dc0c4392dbfcb9adec22a776e745dd69 |
| https://git.kernel.org/stable/c/98cdac206b112bec63852e94802791e316acc2c1 |
| https://git.kernel.org/stable/c/3f0784b2f1eb9147973d8c43ba085c5fdf44ff69 |
| https://git.kernel.org/stable/c/203a68151e8eeb331d4a64ab78303f3a15faf103 |
| https://git.kernel.org/stable/c/ecc6a2101840177e57c925c102d2d29f260d37c8 |