CVE-2025-38000 Overview
A use-after-free vulnerability has been discovered in the Linux kernel's HFSC (Hierarchical Fair Service Curve) scheduler (sch_hfsc). The flaw exists in the hfsc_enqueue() function, where a queue length accounting bug can lead to memory corruption and potential privilege escalation. When enqueuing the first packet to an HFSC class, the function calls the child qdisc's peek() operation before properly incrementing the queue statistics, creating a race condition that can leave dangling references to freed memory.
Critical Impact
Local attackers with low privileges can exploit this use-after-free condition to potentially achieve privilege escalation or cause system instability through memory corruption in the kernel's traffic control subsystem.
Affected Products
- Linux Kernel (multiple versions including 6.15-rc1 through 6.15-rc7)
- Debian Linux 11.0
- Linux Kernel stable branches requiring patches
Discovery Timeline
- June 6, 2025 - CVE-2025-38000 published to NVD
- December 16, 2025 - Last updated in NVD database
Technical Details for CVE-2025-38000
Vulnerability Analysis
This vulnerability stems from improper ordering of operations within the HFSC qdisc's packet enqueue path. The HFSC scheduler is a sophisticated traffic control mechanism used in the Linux kernel's network stack for hierarchical bandwidth management. The bug manifests when the first packet is enqueued to an HFSC class.
During the enqueue process, hfsc_enqueue() calls the child qdisc's peek() operation to examine the packet. However, this call occurs before the parent qdisc's sch->q.qlen and sch->qstats.backlog counters have been incremented. If the child qdisc utilizes qdisc_peek_dequeued(), this can trigger an immediate dequeue operation and potential packet drop within the peek context.
When a packet is dropped during this peek operation, qdisc_tree_reduce_backlog() is invoked to update the queue statistics. Since the HFSC qdisc's counters haven't been updated yet, this leads to inconsistent queue accounting. The consequence is that an empty HFSC class remains in the active list, and subsequent operations may access freed memory structures associated with that class.
Root Cause
The root cause is a time-of-check time-of-use (TOCTOU) style race condition combined with incorrect operation ordering. The queue length and backlog statistics are incremented after the peek operation rather than before it. When qdisc_peek_dequeued() triggers a dequeue and potential drop, the tree's backlog reduction mechanism operates on stale counter values, corrupting the queue state and potentially leaving references to freed packet data structures.
Attack Vector
The attack vector requires local access to the system. An attacker needs the ability to configure traffic control qdiscs (typically requiring CAP_NET_ADMIN capability or root privileges) or exploit a misconfigured system where unprivileged users can manipulate network scheduling. The attacker can craft specific network traffic patterns that trigger the vulnerable code path in hfsc_enqueue(), causing:
- The first packet enqueue to trigger a child qdisc peek
- The peek operation to invoke qdisc_peek_dequeued() resulting in an immediate dequeue/drop
- Queue accounting corruption leaving an empty class in the active list
- Subsequent operations accessing the freed memory, leading to use-after-free exploitation
The vulnerability can be exploited to achieve arbitrary code execution in kernel context, privilege escalation, or denial of service through kernel panic.
Detection Methods for CVE-2025-38000
Indicators of Compromise
- Unexpected kernel oops or panics referencing sch_hfsc, hfsc_enqueue, or related traffic control functions
- KASAN (Kernel Address Sanitizer) reports indicating use-after-free in the net/sched/sch_hfsc.c code paths
- Anomalous traffic control configuration changes or unexpected qdisc modifications in system logs
- System instability when HFSC traffic shaping is actively configured and under load
Detection Strategies
- Enable KASAN in kernel builds for development and testing environments to detect memory corruption early
- Monitor kernel logs for oops messages containing sch_hfsc or qdisc_tree_reduce_backlog stack traces
- Implement audit rules to track tc command usage and qdisc configuration changes
- Deploy SentinelOne Singularity to detect and prevent kernel-level exploitation attempts
Monitoring Recommendations
- Review systems actively using HFSC traffic control (tc qdisc show output) to identify potentially affected configurations
- Enable kernel crash dump collection to capture forensic data in case of exploitation
- Monitor for unusual privilege escalation attempts following network configuration changes
- Track kernel module loading events, particularly around traffic control components
How to Mitigate CVE-2025-38000
Immediate Actions Required
- Apply the official kernel patches from the stable kernel branches immediately
- If patching is not immediately possible, consider temporarily disabling HFSC qdisc configurations where feasible
- Restrict CAP_NET_ADMIN capability to essential services and trusted users only
- Update Debian 11.0 systems using the packages referenced in the LTS announcements
Patch Information
Multiple patches have been released for various kernel stable branches. The fix reorders the increment of sch->q.qlen and sch->qstats.backlog to occur before the call to the child qdisc's peek() operation, ensuring queue accounting remains consistent even when packet drops occur during the peek.
Available patches from kernel.org:
- Kernel Git Commit 1034e331
- Kernel Git Commit 3f3a22ee
- Kernel Git Commit 3f981138
- Kernel Git Commit 49b21795
- Kernel Git Commit 89c301e9
- Kernel Git Commit 93c27694
- Kernel Git Commit f1dde3eb
- Kernel Git Commit f9f593e3
Debian users should reference:
Workarounds
- Remove or replace HFSC qdisc configurations with alternative schedulers (such as HTB or FQ_CODEL) until patching is complete
- Implement network namespace isolation to limit the attack surface for untrusted processes
- Restrict access to traffic control utilities (tc) using file permissions or mandatory access control policies
# Check for HFSC qdisc usage on the system
tc qdisc show | grep hfsc
# Temporarily remove HFSC qdisc (replace eth0 with your interface)
tc qdisc del dev eth0 root handle 1: hfsc
# Verify kernel version and check if patch is applied
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

