CVE-2024-26885
Linux Kernel BPF DEVMAP_HASH Integer Overflow Vulnerability
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix DEVMAP_HASH overflow check on 32-bit arches The devmap code allocates a number hash buckets equal to the next power of two of the max_entries value provided when creating the map. When rounding up to the next power of two, the 32-bit variable storing the number of buckets can overflow, and the code checks for overflow by checking if the truncated 32-bit value is equal to 0. However, on 32-bit arches the rounding up itself can overflow mid-way through, because it ends up doing a left-shift of 32 bits on an unsigned long value. If the size of an unsigned long is four bytes, this is undefined behaviour, so there is no guarantee that we'll end up with a nice and tidy 0-value at the end. Syzbot managed to turn this into a crash on arm32 by creating a DEVMAP_HASH with max_entries > 0x80000000 and then trying to update it. Fix this by moving the overflow check to before the rounding up operation.
INFO
Published Date :
April 17, 2024, 11:15 a.m.
Last Modified :
June 25, 2024, 10:15 p.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
5.9
Exploitability Score :
1.8
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-26885
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-26885
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-26885
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 25, 2024
Action Type Old Value New Value Added Reference kernel.org https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html [No types assigned] -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 29, 2024
Action Type Old Value New Value -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Apr. 29, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Changed Reference Type https://git.kernel.org/stable/c/22079b3a423382335f47d9ed32114e6c9fe88d7c No Types Assigned https://git.kernel.org/stable/c/22079b3a423382335f47d9ed32114e6c9fe88d7c Patch Changed Reference Type https://git.kernel.org/stable/c/225da02acdc97af01b6bc6ce1a3e5362bf01d3fb No Types Assigned https://git.kernel.org/stable/c/225da02acdc97af01b6bc6ce1a3e5362bf01d3fb Patch Changed Reference Type https://git.kernel.org/stable/c/250051acc21f9d4c5c595e4fcb55986ea08c4691 No Types Assigned https://git.kernel.org/stable/c/250051acc21f9d4c5c595e4fcb55986ea08c4691 Patch Changed Reference Type https://git.kernel.org/stable/c/281d464a34f540de166cee74b723e97ac2515ec3 No Types Assigned https://git.kernel.org/stable/c/281d464a34f540de166cee74b723e97ac2515ec3 Patch Changed Reference Type https://git.kernel.org/stable/c/c826502bed93970f2fd488918a7b8d5f1d30e2e3 No Types Assigned https://git.kernel.org/stable/c/c826502bed93970f2fd488918a7b8d5f1d30e2e3 Patch Changed Reference Type https://git.kernel.org/stable/c/e89386f62ce9a9ab9a94835a9890883c23d9d52c No Types Assigned https://git.kernel.org/stable/c/e89386f62ce9a9ab9a94835a9890883c23d9d52c Patch Changed Reference Type https://git.kernel.org/stable/c/edf7990baa48de5097daa9ac02e06cb4c798a737 No Types Assigned https://git.kernel.org/stable/c/edf7990baa48de5097daa9ac02e06cb4c798a737 Patch Added CWE NIST CWE-119 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.4 up to (excluding) 5.10.214 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.153 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.83 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.23 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.7.11 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.8 up to (excluding) 6.8.2 -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Apr. 17, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: bpf: Fix DEVMAP_HASH overflow check on 32-bit arches The devmap code allocates a number hash buckets equal to the next power of two of the max_entries value provided when creating the map. When rounding up to the next power of two, the 32-bit variable storing the number of buckets can overflow, and the code checks for overflow by checking if the truncated 32-bit value is equal to 0. However, on 32-bit arches the rounding up itself can overflow mid-way through, because it ends up doing a left-shift of 32 bits on an unsigned long value. If the size of an unsigned long is four bytes, this is undefined behaviour, so there is no guarantee that we'll end up with a nice and tidy 0-value at the end. Syzbot managed to turn this into a crash on arm32 by creating a DEVMAP_HASH with max_entries > 0x80000000 and then trying to update it. Fix this by moving the overflow check to before the rounding up operation. Added Reference kernel.org https://git.kernel.org/stable/c/225da02acdc97af01b6bc6ce1a3e5362bf01d3fb [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/c826502bed93970f2fd488918a7b8d5f1d30e2e3 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/edf7990baa48de5097daa9ac02e06cb4c798a737 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/250051acc21f9d4c5c595e4fcb55986ea08c4691 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/22079b3a423382335f47d9ed32114e6c9fe88d7c [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/e89386f62ce9a9ab9a94835a9890883c23d9d52c [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/281d464a34f540de166cee74b723e97ac2515ec3 [No types assigned]
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-26885
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-26885
weaknesses.