net_sched: hfsc: Fix a UAF vulnerability in class handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 21f4d5cc25ec0e6e8eb8420dd2c399e6d2fc7d14 · < 86cd4641c713455a4f1c8e54c370c598c2b1cee0| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net_sched: hfsc: Fix a UAF vulnerability in class handling
This patch fixes a Use-After-Free vulnerability in the HFSC qdisc class handling. The issue occurs due to a time-of-check/time-of-use condition in hfsc_change_class() when working with certain child qdiscs like netem or codel.
The vulnerability works as follows: 1. hfsc_change_class() checks if a class has packets (q.qlen != 0) 2. It then calls qdisc_peek_len(), which for certain qdiscs (e.g., codel, netem) might drop packets and empty the queue 3. The code continues assuming the queue is still non-empty, adding the class to vttree 4. This breaks HFSC scheduler assumptions that only non-empty classes are in vttree 5. Later, when the class is destroyed, this can lead to a Use-After-Free
The fix adds a second queue length check after qdisc_peek_len() to verify the queue wasn't emptied.
From the CVE record · Linux
The Linux kernel's HFSC scheduler has a use-after-free flaw in class handling when certain child qdiscs, such as netem or codel, empty a queue during a class change. This can cause the class to be added to a scheduler tree while empty and lead to a use-after-free when the class is later destroyed. The input does not specify an attack route, authentication requirements, or user interaction.
Engineers running Linux kernels that use HFSC with affected child qdiscs should check their versions against the vendor advisory; affected versions were not provided.