Skip to main content

CVE-2025-38001: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-38001cvecve-2025-38001
Published: Fri Jun 06 2025 (06/06/2025, 13:41:45 UTC)
Source: CVE Database V5
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net_sched: hfsc: Address reentrant enqueue adding class to eltree twice Savino says: "We are writing to report that this recent patch (141d34391abbb315d68556b7c67ad97885407547) [1] can be bypassed, and a UAF can still occur when HFSC is utilized with NETEM. The patch only checks the cl->cl_nactive field to determine whether it is the first insertion or not [2], but this field is only incremented by init_vf [3]. By using HFSC_RSC (which uses init_ed) [4], it is possible to bypass the check and insert the class twice in the eltree. Under normal conditions, this would lead to an infinite loop in hfsc_dequeue for the reasons we already explained in this report [5]. However, if TBF is added as root qdisc and it is configured with a very low rate, it can be utilized to prevent packets from being dequeued. This behavior can be exploited to perform subsequent insertions in the HFSC eltree and cause a UAF." To fix both the UAF and the infinite loop, with netem as an hfsc child, check explicitly in hfsc_enqueue whether the class is already in the eltree whenever the HFSC_RSC flag is set. [1] https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=141d34391abbb315d68556b7c67ad97885407547 [2] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L1572 [3] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L677 [4] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L1574 [5] https://lore.kernel.org/netdev/8DuRWwfqjoRDLDmBMlIfbrsZg9Gx50DHJc1ilxsEBNe2D6NMoigR_eIRIG0LOjMc3r10nUUZtArXx4oZBIdUfZQrwjcQhdinnMis_0G7VEk=@willsroot.io/T/#u

AI-Powered Analysis

AILast updated: 07/07/2025, 20:27:39 UTC

Technical Analysis

CVE-2025-38001 is a vulnerability in the Linux kernel's network scheduler subsystem, specifically within the Hierarchical Fair Service Curve (HFSC) queuing discipline implementation. The issue arises from improper handling of class insertion into the 'eltree' data structure used by HFSC. A recent patch intended to fix a reentrant enqueue problem—where a class could be added twice to the eltree—was found to be incomplete. The patch only checked the 'cl_nactive' field to determine if a class was already inserted, but this field is incremented only by the 'init_vf' function. Attackers can bypass this check by using the HFSC_RSC flag, which relies on 'init_ed' instead, allowing the same class to be inserted twice into the eltree. Under normal conditions, this double insertion would cause an infinite loop during dequeue operations. However, if the Token Bucket Filter (TBF) is configured as the root queuing discipline with a very low rate, it can prevent packets from being dequeued, enabling repeated insertions and ultimately leading to a Use-After-Free (UAF) condition. This UAF can potentially be exploited to execute arbitrary code or cause denial of service by kernel memory corruption. The fix involves explicitly checking in the 'hfsc_enqueue' function whether the class is already present in the eltree when the HFSC_RSC flag is set, thereby preventing double insertion and eliminating both the infinite loop and UAF scenarios. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the patch. No known exploits are currently reported in the wild.

Potential Impact

For European organizations, this vulnerability poses significant risks, especially for those relying on Linux-based infrastructure for networking, cloud services, or telecommunications. Exploitation could allow attackers to cause kernel crashes (denial of service) or potentially escalate privileges by executing arbitrary code in kernel space, compromising confidentiality, integrity, and availability of critical systems. Network devices, routers, and servers using HFSC and NETEM queuing disciplines are particularly vulnerable. Given the widespread use of Linux in European data centers, ISPs, and enterprises, successful exploitation could disrupt network traffic management, degrade service quality, or lead to broader system compromises. The complexity of the exploit—requiring specific queuing discipline configurations—may limit widespread exploitation but targeted attacks against critical infrastructure or high-value targets remain a concern. Additionally, the vulnerability could be leveraged in multi-tenant cloud environments common in Europe to escape container or VM isolation.

Mitigation Recommendations

European organizations should promptly apply the official Linux kernel patches that explicitly check for class presence in the eltree when the HFSC_RSC flag is set, as outlined in the referenced commit (141d34391abbb315d68556b7c67ad97885407547). Network administrators should audit their use of HFSC and NETEM queuing disciplines, especially in combination with TBF configured with low rates, and consider temporarily disabling or replacing these configurations until patches are applied. Monitoring kernel logs for unusual enqueue/dequeue behavior or kernel warnings related to HFSC can help detect exploitation attempts. Organizations running custom or older kernel versions should backport the fix or upgrade to a patched kernel release. Additionally, implementing kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR), and enabling kernel lockdown features can reduce exploitation risk. Network segmentation and limiting administrative access to systems managing queuing disciplines will further mitigate attack surface. Finally, maintain up-to-date intrusion detection systems capable of identifying anomalous network scheduling behavior.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-04-16T04:51:23.976Z
Cvss Version
null
State
PUBLISHED

Threat ID: 6842f51971f4d251b5ca3e25

Added to database: 6/6/2025, 2:03:05 PM

Last enriched: 7/7/2025, 8:27:39 PM

Last updated: 8/19/2025, 12:58:25 PM

Views: 43

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