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

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel's HFSC scheduler allows attackers to potentially execute code or escalate privileges via inconsistent queue accounting.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38000?

CVE-2025-38000 is a high-severity use after free vulnerability in Debian Debian Linux, published on 6 Jun 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-416

Which versions are affected by CVE-2025-38000?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38000?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-38000 being exploited?

There is no known exploitation of CVE-2025-38000 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-63684, BELL-CVE-2025-38000, DEBIAN-CVE-2025-38000, GHSA-5fqh-wrrw-3qc9, ROOT-OS-DEBIAN-11-CVE-2025-38000, ROOT-OS-DEBIAN-12-CVE-2025-38000 and 2 more.

Is CVE-2025-38000 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free