CVE-2026-23340: net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs

Published Mar 25, 2026
·
Updated

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

net: sched: avoid qdiscresetalltxgt() vs dequeue race for lockless qdiscs

When shrinking the number of real tx queues, netifsetrealnumtxqueues() calls qdiscresetalltxgt() to flush qdiscs for queues which will no longer be used.

qdiscresetalltxgt() currently serializes qdiscreset() with qdisclock(). However, for lockless qdiscs, the dequeue path is serialized by qdiscrunbegin/end() using qdisc->seqlock instead, so qdiscreset() can run concurrently with qdiscrun() and free skbs while they are still being dequeued, leading to UAF.

This can easily be reproduced on e.g. virtio-net by imposing heavy traffic while frequently changing the number of queue pairs:

iperf3 -ub0 -c $peer -t 0 & while :; do ethtool -L eth0 combined 1 ethtool -L eth0 combined 2 done

With KASAN enabled, this leads to reports like:

BUG: KASAN: slab-use-after-free in qdiscrun+0x133f/0x1760 ... Call Trace: <TASK> ... qdiscrun+0x133f/0x1760 devqueuexmit+0x248f/0x3550 ipfinishoutput2+0xa42/0x2110 ipoutput+0x1a7/0x410 ipsendskb+0x2e6/0x480 udpsendskb+0xb0a/0x1590 udpsendmsg+0x13c9/0x1fc0 ... </TASK>

Allocated by task 1270 on cpu 5 at 44.558414s: ... allocskbwithfrags+0x84/0x7c0 sockallocsendpskb+0x69a/0x830 ipappenddata+0x1b86/0x48c0 ipmakeskb+0x1e8/0x2b0 udpsendmsg+0x13a6/0x1fc0 ...

Freed by task 1306 on cpu 3 at 44.558445s: ... kmemcachefree+0x117/0x5e0 pfifofastreset+0x14d/0x580 qdiscreset+0x9e/0x5f0 netifsetrealnumtxqueues+0x303/0x840 virtnetsetchannels+0x1bf/0x260 [virtionet] ethnlsetchannels+0x684/0xae0 ethnldefaultsetdoit+0x31a/0x890 ...

Serialize qdiscresetalltxgt() against the lockless dequeue path by taking qdisc->seqlock for TCQFNOLOCK qdiscs, matching the serialization model already used by devresetqueue().

Additionally clear QDISCSTATENONEMPTY after reset so the qdisc state reflects an empty queue, avoiding needless re-scheduling.

Affected Software

16 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.126.1-1
Linux Linux kernel>=4.16.1<5.15.203
Linux Linux kernel>=5.16<6.1.167
Linux Linux kernel>=6.2<6.6.130
Linux Linux kernel>=6.7<6.12.77
Linux Linux kernel>=6.13<6.18.17
Linux Linux kernel>=6.19<6.19.7
Linux Linux kernel=4.16
Linux Linux kernel=7.0-rc1
Linux Linux kernel=7.0-rc2
Linux Linux kernel=7.0-rc3
Linux Linux kernel=7.0-rc4
Linux Linux kernel=7.0-rc5
Linux Linux kernel=7.0-rc6
Linux Linux kernel=7.0-rc7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Linux kernel net/sched/qdisc to a version that resolves this vulnerability.

    Patch net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs
  2. Configuration

    Apply the kernel resolution that serializes qdisc_reset_all_tx_gt() against the lockless dequeue path (as described: take the same serialization model used by dev_reset_queue()/qdisc_run_begin/end for lockless qdiscs).

    Linux kernel net/sched/qdisc Serialize qdisc_reset_all_tx_gt() against lockless dequeue path = enabled (by fix)

Event History

Mar 25, 2026
CVE Published
via MITRE·10:27 AM
Data Sourced
via MITRE·10:27 AM
DescriptionSeverity
Data Sourced
via NVD·11:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 26, 2026
Data Sourced
via Microsoft·08:05 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:05 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2026-23340?

CVE-2026-23340 has been classified as a medium severity vulnerability due to potential race conditions affecting lockless qdiscs.

2

How do I fix CVE-2026-23340?

To resolve CVE-2026-23340, update your Linux kernel to the latest version provided by your distribution or vendor that includes the necessary patches.

3

Which versions of the Linux kernel are affected by CVE-2026-23340?

CVE-2026-23340 affects specific versions of the Linux kernel prior to the security fixes implemented in the latest releases.

4

What impact does CVE-2026-23340 have on system performance?

CVE-2026-23340 could negatively impact network performance due to potential race conditions during queue management.

5

Is CVE-2026-23340 easy to exploit?

Exploitation of CVE-2026-23340 requires specific conditions to be met, making it moderately challenging for attackers.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203