# CVE-2025-38000: sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Published: 2025-06-06T13:03:35.405Z
- Modified: 2026-10-15T22:18:23.970Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()

When enqueuing the first packet to an HFSC class, hfsc_enqueue() calls the
child qdisc's peek() operation before incrementing sch->q.qlen and
sch->qstats.backlog. If the child qdisc uses qdisc_peek_dequeued(), this may
trigger an immediate dequeue and potential packet drop. In such cases,
qdisc_tree_reduce_backlog() is called, but the HFSC qdisc's qlen and backlog
have not yet been updated, leading to inconsistent queue accounting. This
can leave an empty HFSC class in the active list, causing further
consequences like use-after-free.

This patch fixes the bug by moving the increment of sch->q.qlen and
sch->qstats.backlog before the call to the child qdisc's peek() operation.
This ensures that queue length and backlog are always accurate when packet
drops or dequeues are triggered during the peek.

(As written by CVE List.)

## Affected

- Linux Linux: from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 1034e3310752e8675e313f7271b348914008719a; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before f9f593e34d2fb67644372c8f7b033bdc622ad228; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 89c301e929a0db14ebd94b4d97764ce1d6981653; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before f1dde3eb17dc1b8bd07aed00004b1e05fc87a3d4; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 93c276942e75de0e5bc91576300d292e968f5a02; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 49b21795b8e5654a7df3d910a12e1060da4c04cf; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 3f3a22eebbc32b4fa8ce9c1d5f9db214b45b9335; from 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 before 3f981138109f63232a5fb7165938d4c945cc1b9d; 4.8 (not affected: before 4.8; from 5.4.294 up to 5.4.*; from 5.10.238 up to 5.10.*; from 5.15.185 up to 5.15.*; from 6.1.141 up to 6.1.*; from 6.6.93 up to 6.6.*; from 6.12.31 up to 6.12.*; from 6.14.9 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 4.8 before 5.4.294; from 5.5 before 5.10.238; from 5.11 before 5.15.185; from 5.16 before 6.1.141; from 6.2 before 6.6.93; from 6.7 before 6.12.31; from 6.13 before 6.14.9; 6.15
- debian debian_linux: 11.0

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/1034e3310752e8675e313f7271b348914008719a> (patch)
- <https://git.kernel.org/stable/c/f9f593e34d2fb67644372c8f7b033bdc622ad228> (patch)
- <https://git.kernel.org/stable/c/89c301e929a0db14ebd94b4d97764ce1d6981653> (patch)
- <https://git.kernel.org/stable/c/f1dde3eb17dc1b8bd07aed00004b1e05fc87a3d4> (patch)
- <https://git.kernel.org/stable/c/93c276942e75de0e5bc91576300d292e968f5a02> (patch)
- <https://git.kernel.org/stable/c/49b21795b8e5654a7df3d910a12e1060da4c04cf> (patch)
- <https://git.kernel.org/stable/c/3f3a22eebbc32b4fa8ce9c1d5f9db214b45b9335> (patch)
- <https://git.kernel.org/stable/c/3f981138109f63232a5fb7165938d4c945cc1b9d> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html> (third-party-advisory)

## Sources

- CVE List: [CVE-2025-38000](https://www.cve.org/CVERecord?id=CVE-2025-38000), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2025-38000](https://nvd.nist.gov/vuln/detail/CVE-2025-38000), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2025-38000 · Whole record: https://cve.day/CVE-2025-38000.json · Rebuilt by cve.day 2026-11-25T22:58:58.861Z
