Skip to main content

CVE-2024-50261: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-50261cvecve-2024-50261
Published: Sat Nov 09 2024 (11/09/2024, 10:15:14 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: macsec: Fix use-after-free while sending the offloading packet KASAN reports the following UAF. The metadata_dst, which is used to store the SCI value for macsec offload, is already freed by metadata_dst_free() in macsec_free_netdev(), while driver still use it for sending the packet. To fix this issue, dst_release() is used instead to release metadata_dst. So it is not freed instantly in macsec_free_netdev() if still referenced by skb. BUG: KASAN: slab-use-after-free in mlx5e_xmit+0x1e8f/0x4190 [mlx5_core] Read of size 2 at addr ffff88813e42e038 by task kworker/7:2/714 [...] Workqueue: mld mld_ifc_work Call Trace: <TASK> dump_stack_lvl+0x51/0x60 print_report+0xc1/0x600 kasan_report+0xab/0xe0 mlx5e_xmit+0x1e8f/0x4190 [mlx5_core] dev_hard_start_xmit+0x120/0x530 sch_direct_xmit+0x149/0x11e0 __qdisc_run+0x3ad/0x1730 __dev_queue_xmit+0x1196/0x2ed0 vlan_dev_hard_start_xmit+0x32e/0x510 [8021q] dev_hard_start_xmit+0x120/0x530 __dev_queue_xmit+0x14a7/0x2ed0 macsec_start_xmit+0x13e9/0x2340 dev_hard_start_xmit+0x120/0x530 __dev_queue_xmit+0x14a7/0x2ed0 ip6_finish_output2+0x923/0x1a70 ip6_finish_output+0x2d7/0x970 ip6_output+0x1ce/0x3a0 NF_HOOK.constprop.0+0x15f/0x190 mld_sendpack+0x59a/0xbd0 mld_ifc_work+0x48a/0xa80 process_one_work+0x5aa/0xe50 worker_thread+0x79c/0x1290 kthread+0x28f/0x350 ret_from_fork+0x2d/0x70 ret_from_fork_asm+0x11/0x20 </TASK> Allocated by task 3922: kasan_save_stack+0x20/0x40 kasan_save_track+0x10/0x30 __kasan_kmalloc+0x77/0x90 __kmalloc_noprof+0x188/0x400 metadata_dst_alloc+0x1f/0x4e0 macsec_newlink+0x914/0x1410 __rtnl_newlink+0xe08/0x15b0 rtnl_newlink+0x5f/0x90 rtnetlink_rcv_msg+0x667/0xa80 netlink_rcv_skb+0x12c/0x360 netlink_unicast+0x551/0x770 netlink_sendmsg+0x72d/0xbd0 __sock_sendmsg+0xc5/0x190 ____sys_sendmsg+0x52e/0x6a0 ___sys_sendmsg+0xeb/0x170 __sys_sendmsg+0xb5/0x140 do_syscall_64+0x4c/0x100 entry_SYSCALL_64_after_hwframe+0x4b/0x53 Freed by task 4011: kasan_save_stack+0x20/0x40 kasan_save_track+0x10/0x30 kasan_save_free_info+0x37/0x50 poison_slab_object+0x10c/0x190 __kasan_slab_free+0x11/0x30 kfree+0xe0/0x290 macsec_free_netdev+0x3f/0x140 netdev_run_todo+0x450/0xc70 rtnetlink_rcv_msg+0x66f/0xa80 netlink_rcv_skb+0x12c/0x360 netlink_unicast+0x551/0x770 netlink_sendmsg+0x72d/0xbd0 __sock_sendmsg+0xc5/0x190 ____sys_sendmsg+0x52e/0x6a0 ___sys_sendmsg+0xeb/0x170 __sys_sendmsg+0xb5/0x140 do_syscall_64+0x4c/0x100 entry_SYSCALL_64_after_hwframe+0x4b/0x53

AI-Powered Analysis

AILast updated: 07/02/2025, 23:29:13 UTC

Technical Analysis

CVE-2024-50261 is a high-severity use-after-free (UAF) vulnerability in the Linux kernel's MACsec (Media Access Control Security) implementation. MACsec is a security protocol that provides data confidentiality, integrity, and origin authenticity for Ethernet frames. The vulnerability arises from improper memory management of the metadata_dst structure, which stores the Secure Channel Identifier (SCI) used for MACsec offloading. Specifically, the metadata_dst is prematurely freed by metadata_dst_free() in macsec_free_netdev(), but the driver continues to reference it when sending packets. This leads to a use-after-free condition detected by Kernel Address Sanitizer (KASAN) during packet transmission in the mlx5_core driver (mlx5e_xmit function). The flaw allows an attacker with limited privileges (requires local privileges and no user interaction) to potentially execute arbitrary code, cause denial of service (kernel panic or system crash), or escalate privileges by exploiting the dangling pointer. The fix involves replacing the immediate free call with dst_release(), which defers freeing until all references are released, preventing premature deallocation. The vulnerability affects Linux kernel versions identified by the commit hash 0a28bfd4971fd570d1f3e4653b21415becefc92c and likely other versions containing the vulnerable MACsec code. The CVSS v3.1 base score is 7.8, reflecting high impact on confidentiality, integrity, and availability, with low attack complexity but requiring local privileges. No known exploits are currently reported in the wild, but the vulnerability's nature and kernel component affected make it a significant risk for systems using MACsec offloading, especially on hardware using mlx5 (Mellanox) drivers.

Potential Impact

For European organizations, the impact of CVE-2024-50261 can be substantial, particularly for enterprises and service providers relying on Linux-based infrastructure with MACsec enabled for secure Ethernet communications. MACsec is often deployed in data centers, telecom networks, and critical infrastructure to protect data in transit at Layer 2. Exploitation could allow attackers to compromise system integrity, gain elevated privileges, or cause denial of service, disrupting network security and availability. This is especially critical for sectors such as finance, telecommunications, government, and energy, where secure and reliable network operations are paramount. The vulnerability could also undermine compliance with European data protection regulations (e.g., GDPR) if confidentiality is breached. Since the flaw requires local privileges, insider threats or compromised user accounts pose a risk vector. The absence of known exploits provides a window for proactive patching, but the high severity score necessitates urgent attention to prevent potential targeted attacks.

Mitigation Recommendations

1. Immediate application of the official Linux kernel patches that address CVE-2024-50261 is essential. Organizations should track kernel updates from their Linux distribution vendors and deploy security updates promptly. 2. Disable MACsec offloading on network interfaces using mlx5 drivers if patching cannot be immediately applied, as a temporary mitigation to prevent triggering the vulnerability. 3. Restrict local user privileges and enforce strict access controls to minimize the risk of local exploitation. 4. Monitor system logs and kernel messages for unusual activity or KASAN reports indicating use-after-free errors related to MACsec or mlx5e_xmit. 5. Conduct thorough audits of network device configurations to ensure MACsec is correctly implemented and unnecessary offloading features are disabled. 6. Employ host-based intrusion detection systems (HIDS) to detect anomalous kernel behavior. 7. For critical environments, consider network segmentation to limit exposure of vulnerable systems. 8. Educate system administrators about this vulnerability and the importance of timely patch management in kernel components.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T19:36:19.981Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9824c4522896dcbdf6b7

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

Last enriched: 7/2/2025, 11:29:13 PM

Last updated: 8/12/2025, 3:51:28 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