Skip to main content

CVE-2024-42073: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-42073cvecve-2024-42073
Published: Mon Jul 29 2024 (07/29/2024, 15:52:36 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mlxsw: spectrum_buffers: Fix memory corruptions on Spectrum-4 systems The following two shared buffer operations make use of the Shared Buffer Status Register (SBSR): # devlink sb occupancy snapshot pci/0000:01:00.0 # devlink sb occupancy clearmax pci/0000:01:00.0 The register has two masks of 256 bits to denote on which ingress / egress ports the register should operate on. Spectrum-4 has more than 256 ports, so the register was extended by cited commit with a new 'port_page' field. However, when filling the register's payload, the driver specifies the ports as absolute numbers and not relative to the first port of the port page, resulting in memory corruptions [1]. Fix by specifying the ports relative to the first port of the port page. [1] BUG: KASAN: slab-use-after-free in mlxsw_sp_sb_occ_snapshot+0xb6d/0xbc0 Read of size 1 at addr ffff8881068cb00f by task devlink/1566 [...] Call Trace: <TASK> dump_stack_lvl+0xc6/0x120 print_report+0xce/0x670 kasan_report+0xd7/0x110 mlxsw_sp_sb_occ_snapshot+0xb6d/0xbc0 mlxsw_devlink_sb_occ_snapshot+0x75/0xb0 devlink_nl_sb_occ_snapshot_doit+0x1f9/0x2a0 genl_family_rcv_msg_doit+0x20c/0x300 genl_rcv_msg+0x567/0x800 netlink_rcv_skb+0x170/0x450 genl_rcv+0x2d/0x40 netlink_unicast+0x547/0x830 netlink_sendmsg+0x8d4/0xdb0 __sys_sendto+0x49b/0x510 __x64_sys_sendto+0xe5/0x1c0 do_syscall_64+0xc1/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f [...] Allocated by task 1: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x8f/0xa0 copy_verifier_state+0xbc2/0xfb0 do_check_common+0x2c51/0xc7e0 bpf_check+0x5107/0x9960 bpf_prog_load+0xf0e/0x2690 __sys_bpf+0x1a61/0x49d0 __x64_sys_bpf+0x7d/0xc0 do_syscall_64+0xc1/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 1: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 poison_slab_object+0x109/0x170 __kasan_slab_free+0x14/0x30 kfree+0xca/0x2b0 free_verifier_state+0xce/0x270 do_check_common+0x4828/0xc7e0 bpf_check+0x5107/0x9960 bpf_prog_load+0xf0e/0x2690 __sys_bpf+0x1a61/0x49d0 __x64_sys_bpf+0x7d/0xc0 do_syscall_64+0xc1/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f

AI-Powered Analysis

AILast updated: 06/29/2025, 04:54:55 UTC

Technical Analysis

CVE-2024-42073 is a vulnerability identified in the Linux kernel specifically affecting the mlxsw driver used for managing Spectrum-4 network switch systems. The issue arises from improper handling of the Shared Buffer Status Register (SBSR), which is used by two shared buffer operations: 'devlink sb occupancy snapshot' and 'devlink sb occupancy clearmax'. The SBSR register contains two 256-bit masks to indicate ingress and egress ports for operation. However, Spectrum-4 systems support more than 256 ports, requiring an extension of the register with a 'port_page' field to segment ports into pages. The vulnerability occurs because the driver incorrectly specifies ports as absolute numbers rather than relative to the first port of the port page when filling the register's payload. This miscalculation leads to memory corruption, specifically a use-after-free condition detected by Kernel Address Sanitizer (KASAN), which can cause kernel crashes or unpredictable behavior. The detailed kernel stack trace shows that the corruption happens during the execution of devlink commands interacting with the shared buffer occupancy snapshot functionality, potentially triggered by user-space processes with access to devlink interfaces. The root cause is a logic error in port indexing within the mlxsw_sp_sb_occ_snapshot function, fixed by adjusting port references to be relative to the port page base. This vulnerability affects Linux kernel versions containing the faulty mlxsw driver code prior to the patch and is relevant for systems running Spectrum-4 switches. No known exploits are reported in the wild as of the publication date, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to data centers, telecommunications providers, and enterprises using Linux-based Spectrum-4 network switches for high-performance networking infrastructure. Exploitation could lead to kernel memory corruption resulting in denial of service (system crashes or reboots) or potentially enable privilege escalation or arbitrary code execution within the kernel context if combined with other vulnerabilities. This could disrupt critical network services, degrade performance, or cause outages impacting business operations. Confidentiality and integrity impacts are possible if attackers leverage the memory corruption to execute malicious code or access sensitive kernel memory. Given the specialized nature of the hardware (Spectrum-4 switches) and the requirement for access to devlink interfaces, the threat is more relevant to organizations with advanced networking setups rather than general desktop or server Linux users. However, the widespread use of Linux in European enterprise and telecom environments means that the vulnerability could affect a significant number of critical infrastructure deployments if unpatched.

Mitigation Recommendations

1. Immediate application of the official Linux kernel patches that correct the port indexing logic in the mlxsw driver is essential. Organizations should track Linux kernel updates and deploy security patches promptly on all affected systems running Spectrum-4 switches. 2. Restrict access to devlink interfaces to trusted administrators only, minimizing the risk of unauthorized triggering of the vulnerable operations. 3. Implement kernel runtime security monitoring tools capable of detecting anomalous kernel memory corruption or crashes to provide early warning of exploitation attempts. 4. Conduct thorough testing of network switch firmware and Linux kernel updates in staging environments before production deployment to avoid service disruptions. 5. For organizations using Spectrum-4 switches in virtualized or containerized environments, ensure that kernel namespaces and access controls are properly configured to limit exposure. 6. Maintain up-to-date inventories of hardware and software to quickly identify systems running vulnerable kernel versions and affected drivers. 7. Engage with hardware vendors and Linux distribution maintainers for coordinated vulnerability disclosure and patch management.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-29T15:50:41.169Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe1974

Added to database: 5/21/2025, 9:08:55 AM

Last enriched: 6/29/2025, 4:54:55 AM

Last updated: 8/18/2025, 11:32:48 PM

Views: 16

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats