sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 12d0ad3be9c3854e52ec74bb83bb6f43612827c7 · < 49b21795b8e5654a7df3d910a12e1060da4c04cf| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
A queue-accounting bug in the Linux kernel’s HFSC scheduler can leave an empty class on the active list and lead to use-after-free. It can occur when a child queue discipline uses qdisc_peek_dequeued() and a peek triggers a dequeue or packet drop. The input does not specify an attacker’s access requirements or whether user interaction is needed.
Engineers running Linux kernels with HFSC configured should check their versions against the vendor advisory; affected versions were not provided.