HIGH Public exploit Introduced in 2.6.34
net/sched Qdisc Qlen Desync
CVE-2025-21702
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: pfifo_tail_enqueue: Drop new packet when sch->limit == 0 Expected behaviour: In case we reach scheduler's limit, pfifo_tail_enqueue() will drop a packet in scheduler's queue and decrease scheduler's qlen by one. Then, pfifo_tail_enqueue() enqueue new packet and increase scheduler's qlen by one. Finally, pfifo_tail_enqueue() return `NET_XMIT_CN` status code. Weird behaviour: In case we set `sch->limit == 0` and trigger pfifo_tail_enqueue() on a scheduler that has no packet, the 'drop a packet' step will do nothing. This means the scheduler's qlen still has value equal 0. Then, we continue to enqueue new packet and increase scheduler's qlen by one. In summary, we can leverage pfifo_tail_enqueue() to increase qlen by one and return `NET_XMIT_CN` status code. The problem is: Let's say we have two qdiscs: Qdisc_A and Qdisc_B. - Qdisc_A's type must have '->graft()' function to create parent/child relationship. Let's say Qdisc_A's type is `hfsc`. Enqueue packet to this qdisc will trigger `hfsc_enqueue`. - Qdisc_B's type is pfifo_head_drop. Enqueue packet to this qdisc will trigger `pfifo_tail_enqueue`. - Qdisc_B is configured to have `sch->limit == 0`. - Qdisc_A is configured to route the enqueued's packet to Qdisc_B. Enqueue packet through Qdisc_A will lead to: - hfsc_enqueue(Qdisc_A) -> pfifo_tail_enqueue(Qdisc_B) - Qdisc_B->q.qlen += 1 - pfifo_tail_enqueue() return `NET_XMIT_CN` - hfsc_enqueue() check for `NET_XMIT_SUCCESS` and see `NET_XMIT_CN` => hfsc_enqueue() don't increase qlen of Qdisc_A. The whole process lead to a situation where Qdisc_A->q.qlen == 0 and Qdisc_B->q.qlen == 1. Replace 'hfsc' with other type (for example: 'drr') still lead to the same problem. This violate the design where parent's qlen should equal to the sum of its childrens'qlen. Bug impact: This issue can be used for user->kernel privilege escalation when it is reachable.
02KernelScan AI Analysis
Risk summary
A logic flaw in the pfifo_head_drop qdisc allows a local attacker to desynchronize the queue length tracking between a parent and child qdisc. This can be leveraged for user-to-kernel privilege escalation. The attack requires the ability to configure qdiscs, which is typically gated by CAP_NET_ADMIN.
Vulnerability analysis
When a head-drop packet scheduler is configured with a queue limit of zero, its enqueue logic fails to drop an incoming packet as expected. Instead, the scheduler increments its internal packet count and signals congestion. Because the parent scheduler treats this signal as a non-success status, it does not update its own count, causing the parent and child to disagree on how many packets are queued. This broken invariant can be leveraged for privilege escalation. The fix adds a check that immediately drops any packet when the limit is set to zero, preventing the mismatch. A local attacker who can configure network schedulers can reach this path; on typical configurations this capability is available inside unprivileged user namespaces.
Exploit availability
KernelScan found public exploit code for this CVE. Open it in the CVE browser to see what we found, where, and how strong the evidence is — that needs a free account with a confirmed email address.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 2.6.34 | 5.10.235 | 7a9723ec27af |
| 5.15 | 2.6.34 | 5.15.179 | a56a6e8589a9 |
| 5.4 | 2.6.34 | 5.4.291 | 78285b53266d |
| 6.1 | 2.6.34 | 6.1.130 | 020ecb76812a |
| 6.12 | 2.6.34 | 6.12.14 | e40cb34b7f24 |
| 6.13 | 2.6.34 | 6.13.3 | b6a079c3b6f9 |
| 6.6 | 2.6.34 | 6.6.83 | 79a955ea4a2e |
| mainline | 2.6.34 | 6.14 | 647cef20e649 |
| cip/4.19 | 2.6.34 | 4.19.325-cip119 | c08f229f70f8 |
| cip/4.19-rt | 2.6.34 | 4.19.325-cip120-rt42 | c08f229f70f8 |
| cip/4.4 | 2.6.34 | 4.4.302-cip98 | 8466b160abf4 |
| cip/4.4-rt | 2.6.34 | 4.4.302-cip98-rt55 | 8466b160abf4 |
| cip/5.10 | 2.6.34 | 5.10.235-cip58 | 7a9723ec27af |
| cip/5.10-rt | 2.6.34 | 5.10.237-cip60-rt26 | 7a9723ec27af |
| cip/6.1 | 2.6.34 | 6.1.131-cip39 | 020ecb76812a |
| cip/6.1-rt | 2.6.34 | 6.1.132-cip40-rt21 | 020ecb76812a |
| cip/6.12 | 2.6.34 | 6.12.29-cip1 | e40cb34b7f24 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.29-cip1 |
| cip/6.1 | Fixed in 6.1.131-cip39 |
| cip/6.1-rt | Fixed in 6.1.132-cip40-rt21 |
| cip/5.10 | Fixed in 5.10.235-cip58 |
| cip/5.10-rt | Fixed in 5.10.237-cip60-rt26 |
| cip/4.19 | Fixed in 4.19.325-cip119 |
| cip/4.19-rt | Fixed in 4.19.325-cip120-rt42 |
| cip/4.4 | Fixed in 4.4.302-cip98 |
| cip/4.4-rt | Fixed in 4.4.302-cip98-rt55 |