KernelScan.io

HIGH Public exploit Introduced in 2.6.34

net/sched Qdisc Qlen Desync

CVE-2025-21702

CVSS 7.0 / 10.0 NVD

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

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.

02

Engine v0.6.0

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.

Affectednet/sched/sch_fifo.c (net/sched)

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.

03

BranchIntroducedFixed inPatch commit
5.102.6.345.10.2357a9723ec27af
5.152.6.345.15.179a56a6e8589a9
5.42.6.345.4.29178285b53266d
6.12.6.346.1.130020ecb76812a
6.122.6.346.12.14e40cb34b7f24
6.132.6.346.13.3b6a079c3b6f9
6.62.6.346.6.8379a955ea4a2e
mainline2.6.346.14647cef20e649
cip/4.192.6.344.19.325-cip119c08f229f70f8
cip/4.19-rt2.6.344.19.325-cip120-rt42c08f229f70f8
cip/4.42.6.344.4.302-cip988466b160abf4
cip/4.4-rt2.6.344.4.302-cip98-rt558466b160abf4
cip/5.102.6.345.10.235-cip587a9723ec27af
cip/5.10-rt2.6.345.10.237-cip60-rt267a9723ec27af
cip/6.12.6.346.1.131-cip39020ecb76812a
cip/6.1-rt2.6.346.1.132-cip40-rt21020ecb76812a
cip/6.122.6.346.12.29-cip1e40cb34b7f24

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.29-cip1
cip/6.1Fixed in 6.1.131-cip39
cip/6.1-rtFixed in 6.1.132-cip40-rt21
cip/5.10Fixed in 5.10.235-cip58
cip/5.10-rtFixed in 5.10.237-cip60-rt26
cip/4.19Fixed in 4.19.325-cip119
cip/4.19-rtFixed in 4.19.325-cip120-rt42
cip/4.4Fixed in 4.4.302-cip98
cip/4.4-rtFixed in 4.4.302-cip98-rt55