CVE-2024-46828
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
27/09/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
sched: sch_cake: fix bulk flow accounting logic for host fairness<br />
<br />
In sch_cake, we keep track of the count of active bulk flows per host,<br />
when running in dst/src host fairness mode, which is used as the<br />
round-robin weight when iterating through flows. The count of active<br />
bulk flows is updated whenever a flow changes state.<br />
<br />
This has a peculiar interaction with the hash collision handling: when a<br />
hash collision occurs (after the set-associative hashing), the state of<br />
the hash bucket is simply updated to match the new packet that collided,<br />
and if host fairness is enabled, that also means assigning new per-host<br />
state to the flow. For this reason, the bulk flow counters of the<br />
host(s) assigned to the flow are decremented, before new state is<br />
assigned (and the counters, which may not belong to the same host<br />
anymore, are incremented again).<br />
<br />
Back when this code was introduced, the host fairness mode was always<br />
enabled, so the decrement was unconditional. When the configuration<br />
flags were introduced the *increment* was made conditional, but<br />
the *decrement* was not. Which of course can lead to a spurious<br />
decrement (and associated wrap-around to U16_MAX).<br />
<br />
AFAICT, when host fairness is disabled, the decrement and wrap-around<br />
happens as soon as a hash collision occurs (which is not that common in<br />
itself, due to the set-associative hashing). However, in most cases this<br />
is harmless, as the value is only used when host fairness mode is<br />
enabled. So in order to trigger an array overflow, sch_cake has to first<br />
be configured with host fairness disabled, and while running in this<br />
mode, a hash collision has to occur to cause the overflow. Then, the<br />
qdisc has to be reconfigured to enable host fairness, which leads to the<br />
array out-of-bounds because the wrapped-around value is retained and<br />
used as an array index. It seems that syzbot managed to trigger this,<br />
which is quite impressive in its own right.<br />
<br />
This patch fixes the issue by introducing the same conditional check on<br />
decrement as is used on increment.<br />
<br />
The original bug predates the upstreaming of cake, but the commit listed<br />
in the Fixes tag touched that code, meaning that this patch won&#39;t apply<br />
before that.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.1 (including) | 5.4.284 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.10 (including) | 5.10.226 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15 (including) | 5.15.167 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.1 (including) | 6.1.110 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.6 (including) | 6.6.51 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.10 (including) | 6.10.10 (excluding) |
| 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:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/4a4eeefa514db570be025ab46d779af180e2c9bb
- https://git.kernel.org/stable/c/546ea84d07e3e324644025e2aae2d12ea4c5896e
- https://git.kernel.org/stable/c/549e407569e08459d16122341d332cb508024094
- https://git.kernel.org/stable/c/7725152b54d295b7da5e34c2f419539b30d017bd
- https://git.kernel.org/stable/c/cde71a5677971f4f1b69b25e854891dbe78066a4
- https://git.kernel.org/stable/c/d4a9039a7b3d8005b90c7b1a55a306444f0e5447
- https://git.kernel.org/stable/c/d7c01c0714c04431b5e18cf17a9ea68a553d1c3c
- https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html



