CVE-2024-35853

mlxsw: spectrum_acl_tcam: Fix memory leak during rehash

6.4 medium EPSS 0.73%

Published 17 May 2024 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2024-35853

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-35853 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.

Check my servers

Description

In the Linux kernel, the following vulnerability has been resolved:

mlxsw: spectrum_acl_tcam: Fix memory leak during rehash

The rehash delayed work migrates filters from one region to another. This is done by iterating over all chunks (all the filters with the same priority) in the region and in each chunk iterating over all the filters.

If the migration fails, the code tries to migrate the filters back to the old region. However, the rollback itself can also fail in which case another migration will be erroneously performed. Besides the fact that this ping pong is not a very good idea, it also creates a problem.

Each virtual chunk references two chunks: The currently used one ('vchunk->chunk') and a backup ('vchunk->chunk2'). During migration the first holds the chunk we want to migrate filters to and the second holds the chunk we are migrating filters from.

The code currently assumes - but does not verify - that the backup chunk does not exist (NULL) if the currently used chunk does not reference the target region. This assumption breaks when we are trying to rollback a rollback, resulting in the backup chunk being overwritten and leaked [1].

Fix by not rolling back a failed rollback and add a warning to avoid future cases.

[1] WARNING: CPU: 5 PID: 1063 at lib/parman.c:291 parman_destroy+0x17/0x20 Modules linked in: CPU: 5 PID: 1063 Comm: kworker/5:11 Tainted: G W 6.9.0-rc2-custom-00784-gc6a05c468a0b #14 Hardware name: Mellanox Technologies Ltd. MSN3700/VMOD0005, BIOS 5.11 01/06/2019 Workqueue: mlxsw_core mlxsw_sp_acl_tcam_vregion_rehash_work RIP: 0010:parman_destroy+0x17/0x20 [...] Call Trace: <TASK> mlxsw_sp_acl_atcam_region_fini+0x19/0x60 mlxsw_sp_acl_tcam_region_destroy+0x49/0xf0 mlxsw_sp_acl_tcam_vregion_rehash_work+0x1f1/0x470 process_one_work+0x151/0x370 worker_thread+0x2cb/0x3e0 kthread+0xd0/0x100 ret_from_fork+0x34/0x50 ret_from_fork_asm+0x1a/0x30 </TASK>

Severity (CVSS)

6.4 medium CVSS 3.1 from CISA (ADP)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
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 low, integrity low, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.73%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 55.3% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 20 May 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.

ProductVersions
Linux
affected from 843500518509128a935edab96bd8efef7c54669e, before c6f3fa7f5a748bf6e5c4eb742686d6952f854e76
affected from 843500518509128a935edab96bd8efef7c54669e, before 617e98ba4c50f4547c9eb0946b1cfc26937d70d1
affected from 843500518509128a935edab96bd8efef7c54669e, before 413a01886c3958d4b8aac23a3bff3d430b92093e
affected from 843500518509128a935edab96bd8efef7c54669e, before b822644fd90992ee362c5e0c8d2556efc8856c76
affected from 843500518509128a935edab96bd8efef7c54669e, before 0ae8ff7b6d42e33943af462910bdcfa2ec0cb8cf
affected from 843500518509128a935edab96bd8efef7c54669e, before b3fd51f684a0711504f82de510da109ae639722d
affected from 843500518509128a935edab96bd8efef7c54669e, before 8ca3f7a7b61393804c46f170743c3b839df13977
Other versions: unaffected
Linux
affected 5.1
unaffected before 5.1
unaffected from 5.4.275 up to and including 5.4.*
unaffected from 5.10.216 up to and including 5.10.*
unaffected from 5.15.158 up to and including 5.15.*
unaffected from 6.1.90 up to and including 6.1.*
unaffected from 6.6.30 up to and including 6.6.*
unaffected from 6.8.9 up to and including 6.8.*
unaffected 6.9 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-35853 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-35853

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-35853
trivy image --scanners vuln IMAGE | grep CVE-2024-35853

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

Source: the record CVE-2024-35853 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.