CVE-2024-46828
Apache Linux kernel Circular Array Indexing Vulnerability
Description
In the Linux kernel, the following vulnerability has been resolved: sched: sch_cake: fix bulk flow accounting logic for host fairness In sch_cake, we keep track of the count of active bulk flows per host, when running in dst/src host fairness mode, which is used as the round-robin weight when iterating through flows. The count of active bulk flows is updated whenever a flow changes state. This has a peculiar interaction with the hash collision handling: when a hash collision occurs (after the set-associative hashing), the state of the hash bucket is simply updated to match the new packet that collided, and if host fairness is enabled, that also means assigning new per-host state to the flow. For this reason, the bulk flow counters of the host(s) assigned to the flow are decremented, before new state is assigned (and the counters, which may not belong to the same host anymore, are incremented again). Back when this code was introduced, the host fairness mode was always enabled, so the decrement was unconditional. When the configuration flags were introduced the *increment* was made conditional, but the *decrement* was not. Which of course can lead to a spurious decrement (and associated wrap-around to U16_MAX). AFAICT, when host fairness is disabled, the decrement and wrap-around happens as soon as a hash collision occurs (which is not that common in itself, due to the set-associative hashing). However, in most cases this is harmless, as the value is only used when host fairness mode is enabled. So in order to trigger an array overflow, sch_cake has to first be configured with host fairness disabled, and while running in this mode, a hash collision has to occur to cause the overflow. Then, the qdisc has to be reconfigured to enable host fairness, which leads to the array out-of-bounds because the wrapped-around value is retained and used as an array index. It seems that syzbot managed to trigger this, which is quite impressive in its own right. This patch fixes the issue by introducing the same conditional check on decrement as is used on increment. The original bug predates the upstreaming of cake, but the commit listed in the Fixes tag touched that code, meaning that this patch won't apply before that.
INFO
Published Date :
Sept. 27, 2024, 1:15 p.m.
Last Modified :
Nov. 21, 2024, 3:02 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-46828
.
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-46828
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-46828
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.
-
Initial Analysis by [email protected]
Nov. 21, 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 Added CWE NIST NVD-CWE-noinfo Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.1 up to (excluding) 5.4.284 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.10 up to (excluding) 5.10.226 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.15 up to (excluding) 5.15.167 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.1 up to (excluding) 6.1.110 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.6 up to (excluding) 6.6.51 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.10 up to (excluding) 6.10.10 *cpe:2.3:o:linux:linux_kernel:6.11:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.11:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.11:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.11:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.11:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.11:rc6:*:*:*:*:*:* Changed Reference Type https://git.kernel.org/stable/c/4a4eeefa514db570be025ab46d779af180e2c9bb No Types Assigned https://git.kernel.org/stable/c/4a4eeefa514db570be025ab46d779af180e2c9bb Patch Changed Reference Type https://git.kernel.org/stable/c/546ea84d07e3e324644025e2aae2d12ea4c5896e No Types Assigned https://git.kernel.org/stable/c/546ea84d07e3e324644025e2aae2d12ea4c5896e Patch Changed Reference Type https://git.kernel.org/stable/c/549e407569e08459d16122341d332cb508024094 No Types Assigned https://git.kernel.org/stable/c/549e407569e08459d16122341d332cb508024094 Patch Changed Reference Type https://git.kernel.org/stable/c/7725152b54d295b7da5e34c2f419539b30d017bd No Types Assigned https://git.kernel.org/stable/c/7725152b54d295b7da5e34c2f419539b30d017bd Patch Changed Reference Type https://git.kernel.org/stable/c/cde71a5677971f4f1b69b25e854891dbe78066a4 No Types Assigned https://git.kernel.org/stable/c/cde71a5677971f4f1b69b25e854891dbe78066a4 Patch Changed Reference Type https://git.kernel.org/stable/c/d4a9039a7b3d8005b90c7b1a55a306444f0e5447 No Types Assigned https://git.kernel.org/stable/c/d4a9039a7b3d8005b90c7b1a55a306444f0e5447 Patch Changed Reference Type https://git.kernel.org/stable/c/d7c01c0714c04431b5e18cf17a9ea68a553d1c3c No Types Assigned https://git.kernel.org/stable/c/d7c01c0714c04431b5e18cf17a9ea68a553d1c3c Patch -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Sep. 27, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: sched: sch_cake: fix bulk flow accounting logic for host fairness In sch_cake, we keep track of the count of active bulk flows per host, when running in dst/src host fairness mode, which is used as the round-robin weight when iterating through flows. The count of active bulk flows is updated whenever a flow changes state. This has a peculiar interaction with the hash collision handling: when a hash collision occurs (after the set-associative hashing), the state of the hash bucket is simply updated to match the new packet that collided, and if host fairness is enabled, that also means assigning new per-host state to the flow. For this reason, the bulk flow counters of the host(s) assigned to the flow are decremented, before new state is assigned (and the counters, which may not belong to the same host anymore, are incremented again). Back when this code was introduced, the host fairness mode was always enabled, so the decrement was unconditional. When the configuration flags were introduced the *increment* was made conditional, but the *decrement* was not. Which of course can lead to a spurious decrement (and associated wrap-around to U16_MAX). AFAICT, when host fairness is disabled, the decrement and wrap-around happens as soon as a hash collision occurs (which is not that common in itself, due to the set-associative hashing). However, in most cases this is harmless, as the value is only used when host fairness mode is enabled. So in order to trigger an array overflow, sch_cake has to first be configured with host fairness disabled, and while running in this mode, a hash collision has to occur to cause the overflow. Then, the qdisc has to be reconfigured to enable host fairness, which leads to the array out-of-bounds because the wrapped-around value is retained and used as an array index. It seems that syzbot managed to trigger this, which is quite impressive in its own right. This patch fixes the issue by introducing the same conditional check on decrement as is used on increment. The original bug predates the upstreaming of cake, but the commit listed in the Fixes tag touched that code, meaning that this patch won't apply before that. Added Reference kernel.org https://git.kernel.org/stable/c/4a4eeefa514db570be025ab46d779af180e2c9bb [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/7725152b54d295b7da5e34c2f419539b30d017bd [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/cde71a5677971f4f1b69b25e854891dbe78066a4 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/549e407569e08459d16122341d332cb508024094 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/d4a9039a7b3d8005b90c7b1a55a306444f0e5447 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/d7c01c0714c04431b5e18cf17a9ea68a553d1c3c [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/546ea84d07e3e324644025e2aae2d12ea4c5896e [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-46828
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-46828
weaknesses.