Look up another CVE · open CVE-2025-39677 in the interactive tracker
CVE-2025-39677
net/sched: Fix backlog accounting in qdisc_dequeue_internal
Published 2025-09-05 (13 months ago) by the Linux kernel CNA. Subsystem include/net. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2025-39677 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | vulnerable | 6.12.113-1 | No fix published anywhere yet, neither in Debian nor upstream for the series trixie tracks. Watch the Debian tracker page for this CVE. Advisories for trixie have historically landed a median of 11 days after publication. |
| Debian 14forky | fixed | 6.16.5-1 | Update the kernel and reboot. Fixed in 6.16.5-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.16.5-1 | Update the kernel and reboot. Fixed in 6.16.5-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
This issue applies for the following qdiscs: hhf, fq, fq_codel, and fq_pie, and occurs in their change handlers when adjusting to the new limit. The problem is the following in the values passed to the subsequent qdisc_tree_reduce_backlog call given a tbf parent: When the tbf parent runs out of tokens, skbs of these qdiscs will be placed in gso_skb. Their peek handlers are qdisc_peek_dequeued, which accounts for both qlen and backlog. However, in the case of qdisc_dequeue_internal, ONLY qlen is accounted for when pulling from gso_skb. This means that these qdiscs are missing a qdisc_qstats_backlog_dec when dropping packets to satisfy the new limit in their change handlers. One can observe this issue with the following (with tc patched to support a limit of 0): export TARGET=fq tc qdisc del dev lo root tc qdisc add dev lo root handle 1: tbf rate 8bit burst 100b latency 1ms tc qdisc replace dev lo handle 3: parent 1:1 $TARGET limit 1000 echo ''; echo 'add child'; tc -s -d qdisc show dev lo ping -I lo -f -c2 -s32 -W0.001 127.0.0.1 2>&1 >/dev/null echo ''; echo 'after ping'; tc -s -d qdisc show dev lo tc qdisc change dev lo handle 3: parent 1:1 $TARGET limit 0 echo ''; echo 'after limit drop'; tc -s -d qdisc show dev lo tc qdisc replace dev lo handle 2: parent 1:1 sfq echo ''; echo 'post graft'; tc -s -d qdisc show dev lo The second to last show command shows 0 packets but a positive number (74) of backlog bytes. The problem becomes clearer in the last show command, where qdisc_purge_queue triggers qdisc_tree_reduce_backlog with the positive backlog and causes an underflow in the tbf parent's backlog (4096 Mb instead of 0). To fix this issue, the codepath for all clients of qdisc_dequeue_internal has been simplified: codel, pie, hhf, fq, fq_pie, and fq_codel. qdisc_dequeue_internal handles the backlog adjustments for all cases that do not directly use the dequeue handler. The old fq_codel_change limit adjustment loop accumulated the arguments to the subsequent qdisc_tree_reduce_backlog call through the cstats field. However, this is confusing and error prone as fq_codel_dequeue could also potentially mutate this field (which qdisc_dequeue_internal calls in the non gso_skb case), so we have unified the code here with other qdiscs.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
include/net/sch_generic.h
net/sched/sch_codel.c
net/sched/sch_fq.c
net/sched/sch_fq_codel.c
net/sched/sch_fq_pie.c
net/sched/sch_hhf.c
net/sched/sch_pie.c
- What this is
- NETWORKING [GENERAL]MAINTAINERS section matched on include/net/ · netdev@vger.kernel.org · Maintained
- Kernel module
- sch_codel
Check it on the machine
grep -w CONFIG_NET_SCH_CODEL /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
lsmod | grep -w sch_codelPrints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.
Show whether Debian builds this, per release
Debian builds this as a loadable module. Every release below compiles it as a module on every flavour, so whether the code is in the running kernel depends on whether that module is loaded.
- bookworm, trixie, forky, sidm
- m
- a loadable module on every flavour - check lsmod, can be blacklisted
- Build switch
- CONFIG_NET_SCH_CODEL
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2025-09-05 (13 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.15%, higher than 3.6% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- include/net
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 3.5 | 6.16.4 | a225f44d84b8 |
| 3.5 | 6.17 | 52bf272636bd |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The vulnerability is reached exclusively through RTM_NEWQDISC/tc netlink messages that invoke the qdisc ->change() handlers on a local netlink socket. Per kernel scoring guidance, tc/netlink qdisc configuration is a local attack vector.
- AC:LAttack complexity, low
- The commit message contains a fully deterministic reproducer (tbf parent + fq child, ping to fill the queue, then change the limit and graft) with no race, no memory-layout dependence, and no non-default kernel config — fq and fq_codel are built in on virtually all distributions and fq_codel is the default qdisc.
- PR:LPrivileges required, low
- tc_modify_qdisc is gated only by netlink_net_capable(skb, CAP_NET_ADMIN), which is evaluated against net->user_ns, so an unprivileged user obtains it with `unshare -Urn` and configures qdiscs on the loopback device in the new namespace. No real root in the init namespace is needed.
- UI:NUser interaction, none
- The attacker performs the entire sequence — creating the qdisc hierarchy, generating traffic into the queue, changing the limit, and grafting — with no victim action required.
- S:UScope, unchanged
- The corrupted state and its consequences are confined to the kernel's qdisc tree within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed.
- C:HConfidentiality impact, high
- The qdisc queue-accounting desync is the same primitive that has repeatedly escalated to use-after-free on qdisc class objects via wrongly-driven cops->qlen_notify() (CVE-2025-21703, CVE-2025-38000/38001), and a UAF on those objects yields attacker-controlled reads of freed kernel memory.
- I:HIntegrity impact, high
- The bug produces an attacker-controlled u32 underflow of qstats.backlog that propagates through qdisc_tree_reduce_backlog into every ancestor qdisc, corrupting kernel state that drives class active-list maintenance and enqueue/drop decisions; the resulting accounting desync is exploitable for heap corruption in the same manner as the prior net/sched accounting CVEs.
- A:HAvailability impact, high
- The underflowed backlog permanently blackholes the device (bfifo/plug limit checks and sch_red's qavg see a ~4 GiB queue and drop everything), and the unguarded pre-fix trim loops give an outright kernel oops via qdisc_pkt_len(NULL) in codel/pie/fq_pie/fq_codel or an infinite loop in hhf while holding sch_tree_lock and RTNL.