CVE-2024-35855: mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update
In the Linux kernel, the following vulnerability has been resolved:
mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update
The rule activity update delayed work periodically traverses the list of
configured rules and queries their activity from the device.
As part of this task it accesses the entry pointed by 'ventry->entry',
but this entry can be changed concurrently by the rehash delayed work,
leading to a use-after-free [1].
Fix by closing the race and perform the activity query under the
'vregion->lock' mutex.
[1]
BUG: KASAN: slab-use-after-free in mlxsw_sp_acl_tcam_flower_rule_activity_get+0x121/0x140
Read of size 8 at addr ffff8881054ed808 by task kworker/0:18/181
CPU: 0 PID: 181 Comm: kworker/0:18 Not tainted 6.9.0-rc2-custom-00781-gd5ab772d32f7 #2
Hardware name: Mellanox Technologies Ltd. MSN3700/VMOD0005, BIOS 5.11 01/06/2019
Workqueue: mlxsw_core mlxsw_sp_acl_rule_activity_update_work
Call Trace:
<TASK>
dump_stack_lvl+0xc6/0x120
print_report+0xce/0x670
kasan_report+0xd7/0x110
mlxsw_sp_acl_tcam_flower_rule_activity_get+0x121/0x140
mlxsw_sp_acl_rule_activity_update_work+0x219/0x400
process_one_work+0x8eb/0x19b0
worker_thread+0x6c9/0xf70
kthread+0x2c9/0x3b0
ret_from_fork+0x4d/0x80
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 1039:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0x8f/0xa0
__kmalloc+0x19c/0x360
mlxsw_sp_acl_tcam_entry_create+0x7b/0x1f0
mlxsw_sp_acl_tcam_vchunk_migrate_all+0x30d/0xb50
mlxsw_sp_acl_tcam_vregion_rehash_work+0x157/0x1300
process_one_work+0x8eb/0x19b0
worker_thread+0x6c9/0xf70
kthread+0x2c9/0x3b0
ret_from_fork+0x4d/0x80
ret_from_fork_asm+0x1a/0x30
Freed by task 1039:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
poison_slab_object+0x102/0x170
__kasan_slab_free+0x14/0x30
kfree+0xc1/0x290
mlxsw_sp_acl_tcam_vchunk_migrate_all+0x3d7/0xb50
mlxsw_sp_acl_tcam_vregion_rehash_work+0x157/0x1300
process_one_work+0x8eb/0x19b0
worker_thread+0x6c9/0xf70
kthread+0x2c9/0x3b0
ret_from_fork+0x4d/0x80
ret_from_fork_asm+0x1a/0x30
Security readout for executives and security teams
Plain-English summary
A race condition in the Linux mlxsw driver can make background work access memory after it has been freed. It primarily matters to systems using Mellanox Spectrum switching hardware and ACL TCAM rules. A triggered failure could crash or compromise the kernel, but the supplied evidence does not establish real-world exploitation.
Executive priority
Treat as high priority for Mellanox Spectrum switching infrastructure using hardware ACLs because failure occurs in kernel context. Expedite inventory and vendor-kernel updates on exposed devices. Other Linux systems are unlikely to exercise this driver path, so validate applicability before initiating broad emergency remediation.
Technical view
The mlxsw Spectrum ACL activity worker dereferences ventry->entry while rehash work can concurrently replace and free that entry. KASAN observed a slab use-after-free during mlxsw_sp_acl_tcam_flower_rule_activity_get. The kernel fix serializes the activity query with rehash operations using the vregion->lock mutex.
Likely exposure
Exposure is concentrated in Linux systems using the mlxsw Spectrum ACL TCAM path, especially Mellanox Spectrum switches managing hardware ACL rules. The supplied affected-version data includes kernels through 6.9 and several stable-series releases, but it does not provide a clean universal version range. Distribution backports require separate verification.
Exploitation context
The supplied CVSS is 7.8 with local access, low privileges, low complexity, and potential confidentiality, integrity, and availability impact. The bundle marks the CVE as absent from KEV and provides no evidence of active exploitation or a public exploit. Practical exploitability beyond the demonstrated KASAN failure remains unconfirmed.
Researcher notes
The evidence demonstrates a concurrency flaw between ACL rule activity updates and virtual-region rehash work. KASAN reproduced an eight-byte read after free on a custom 6.9-rc2 kernel running Mellanox MSN3700 hardware. Locking closes the documented race. No CWE, reliable trigger conditions, exploit demonstration, or confirmed attack activity is supplied.
Mitigation direction
Update to a distribution or vendor kernel incorporating the applicable upstream stable fix.
Prioritize Mellanox Spectrum systems actively using mlxsw hardware ACL rules.
If patching is delayed, check vendor guidance; the supplied sources name no workaround.
Monitor relevant systems for kernel crashes or use-after-free diagnostics.
Validation and detection
Inventory kernel versions and identify systems using mlxsw Spectrum ACL TCAM functionality.
Map deployed kernels to vendor advisories and the applicable stable fix commit.
Verify the installed kernel changelog or source includes the vregion->lock activity-query fix.
After updating, test normal ACL changes and monitor kernel logs for memory-safety failures.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-35855 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.