CVE-2024-46828
sched: sch_cake: fix bulk flow accounting logic for host fairness
Check your servers for CVE-2024-46828
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-46828 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity none, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 17.7% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 29 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before 4a4eeefa514db570be025ab46d779af180e2c9bb affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before 7725152b54d295b7da5e34c2f419539b30d017bd affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before cde71a5677971f4f1b69b25e854891dbe78066a4 affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before 549e407569e08459d16122341d332cb508024094 affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before d4a9039a7b3d8005b90c7b1a55a306444f0e5447 affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before d7c01c0714c04431b5e18cf17a9ea68a553d1c3c affected from 712639929912c5eefb09facccb48d55b3f72c9f8, before 546ea84d07e3e324644025e2aae2d12ea4c5896e
Other versions: unaffected
|
| Linux |
affected 5.1 unaffected before 5.1 unaffected from 5.4.284 up to and including 5.4.* unaffected from 5.10.226 up to and including 5.10.* unaffected from 5.15.167 up to and including 5.15.* unaffected from 6.1.110 up to and including 6.1.* unaffected from 6.6.51 up to and including 6.6.* unaffected from 6.10.10 up to and including 6.10.* unaffected 6.11 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-46828 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-46828
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-46828
trivy image --scanners vuln IMAGE | grep CVE-2024-46828
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/4a4eeefa514db570be025ab46d779af180e2c9bb git.kernel.org
- https://git.kernel.org/stable/c/7725152b54d295b7da5e34c2f419539b30d017bd git.kernel.org
- https://git.kernel.org/stable/c/cde71a5677971f4f1b69b25e854891dbe78066a4 git.kernel.org
- https://git.kernel.org/stable/c/549e407569e08459d16122341d332cb508024094 git.kernel.org
- https://git.kernel.org/stable/c/d4a9039a7b3d8005b90c7b1a55a306444f0e5447 git.kernel.org
- https://git.kernel.org/stable/c/d7c01c0714c04431b5e18cf17a9ea68a553d1c3c git.kernel.org
- https://git.kernel.org/stable/c/546ea84d07e3e324644025e2aae2d12ea4c5896e git.kernel.org
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html lists.debian.org
- https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html lists.debian.org
Source: the record CVE-2024-46828 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse