CVE-2023-4921 Overview
A use-after-free vulnerability exists in the Linux kernel's net/sched: sch_qfq component that can be exploited to achieve local privilege escalation. This vulnerability is classified as CWE-416 (Use After Free) and affects the Quick Fair Queueing (QFQ) packet scheduler implementation within the kernel's network traffic control subsystem.
When the plug qdisc is used as a class of the qfq qdisc, sending network packets triggers a use-after-free condition in qfq_dequeue() due to the incorrect .peek handler of sch_plug and lack of error checking in agg_dequeue(). This memory corruption vulnerability allows local attackers with low privileges to potentially escalate their privileges on affected systems.
Critical Impact
Local attackers can exploit this use-after-free vulnerability to achieve privilege escalation, potentially gaining root access on affected Linux systems.
Affected Products
- Linux Kernel (multiple versions)
- Debian Linux 10.0
Discovery Timeline
- September 12, 2023 - CVE-2023-4921 published to NVD
- February 13, 2025 - Last updated in NVD database
Technical Details for CVE-2023-4921
Vulnerability Analysis
This use-after-free vulnerability occurs within the QFQ (Quick Fair Queueing) packet scheduler component of the Linux kernel's network traffic control subsystem. The QFQ scheduler is designed to provide fair bandwidth allocation among different network flows, but a flaw in its interaction with the plug qdisc creates a dangerous memory safety issue.
The vulnerability stems from improper memory management when the plug qdisc is configured as a class within the qfq qdisc hierarchy. During the packet dequeue operation, the qfq_dequeue() function accesses memory that has already been freed, creating a use-after-free condition. This occurs because the .peek handler implementation in sch_plug does not properly handle certain edge cases, and the agg_dequeue() function lacks adequate error checking.
When network packets are sent through this misconfigured qdisc hierarchy, the kernel may access freed memory, leading to memory corruption. An attacker with local access can craft specific network traffic patterns to reliably trigger this condition and potentially manipulate kernel memory to achieve privilege escalation.
Root Cause
The root cause of CVE-2023-4921 lies in two interconnected issues within the kernel's traffic control code:
Incorrect .peek handler in sch_plug: The peek handler does not correctly handle the state transitions when integrated with the QFQ scheduler, returning invalid references to deallocated memory structures.
Missing error checking in agg_dequeue(): The aggregation dequeue function fails to validate that the referenced memory is still valid before attempting to access it, allowing the use-after-free to occur.
These combined deficiencies allow freed memory to be accessed during the packet dequeue path, violating memory safety guarantees and enabling potential exploitation.
Attack Vector
The attack vector for CVE-2023-4921 is local, requiring an attacker to have low-privileged access to the target system. The exploitation scenario involves:
Configuration Setup: The attacker needs the ability to configure traffic control qdiscs, specifically creating a qfq qdisc with a plug qdisc as one of its classes.
Triggering the Vulnerability: Once the vulnerable configuration is in place, sending network packets through the configured interface triggers the use-after-free condition in qfq_dequeue().
Memory Manipulation: By carefully timing the packet transmission and potentially using heap spraying techniques, an attacker can control the contents of the freed memory and redirect kernel execution flow.
Privilege Escalation: Successful exploitation allows the attacker to execute arbitrary code in kernel context, enabling full system compromise and privilege escalation to root.
The vulnerability requires no user interaction and can be exploited with low attack complexity once local access is obtained.
Detection Methods for CVE-2023-4921
Indicators of Compromise
- Unusual traffic control configurations involving qfq and plug qdiscs on network interfaces
- Kernel crash dumps or system instability related to the net/sched subsystem
- Unexpected privilege escalation events or unauthorized root access
- Memory corruption signatures in kernel logs referencing qfq_dequeue or agg_dequeue
Detection Strategies
- Monitor for tc (traffic control) commands configuring qfq qdiscs with plug qdisc classes
- Implement kernel audit rules to track network namespace and traffic control modifications
- Deploy kernel-level monitoring solutions to detect use-after-free exploitation patterns
- Review system logs for kernel panics or oops messages originating from sch_qfq module
Monitoring Recommendations
- Enable kernel memory debugging features (KASAN) in development/testing environments to detect use-after-free conditions
- Monitor for unusual network configuration changes by unprivileged users
- Implement SentinelOne Singularity Platform for real-time kernel-level threat detection and response
- Configure alerts for any unexpected changes to network traffic control settings
How to Mitigate CVE-2023-4921
Immediate Actions Required
- Update the Linux kernel to a patched version that includes commit 8fc134fee27f2263988ae38920bc03da416b03d8
- Restrict access to traffic control commands (tc) using system policies or container isolation
- Review and audit existing qdisc configurations for potentially vulnerable setups
- Apply vendor-specific security updates from distribution maintainers (e.g., Debian LTS advisories)
Patch Information
The vulnerability has been addressed in the upstream Linux kernel. The fix is available in commit 8fc134fee27f2263988ae38920bc03da416b03d8, which corrects the .peek handler behavior and adds proper error checking in the dequeue path.
For detailed patch information, refer to:
Debian users should consult:
Workarounds
- Disable or unload the sch_qfq kernel module if not required: modprobe -r sch_qfq
- Restrict unprivileged user access to network namespace operations
- Use container isolation with restricted capabilities to prevent traffic control manipulation
- Implement network policies that prevent creation of qfq qdiscs with plug qdisc classes
# Configuration example - Disable sch_qfq module
# Add to /etc/modprobe.d/blacklist-qfq.conf
echo "blacklist sch_qfq" >> /etc/modprobe.d/blacklist-qfq.conf
echo "install sch_qfq /bin/false" >> /etc/modprobe.d/blacklist-qfq.conf
# Verify module is not loaded
lsmod | grep sch_qfq
# Remove module if currently loaded
modprobe -r sch_qfq
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

