CVE-2026-23340

Source
https://cve.org/CVERecord?id=CVE-2026-23340
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23340.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-23340
Downstream
Published
2026-03-25T10:27:28.728Z
Modified
2026-04-02T13:12:21.969372Z
Summary
net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs
Details

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 qdiscresetalltx_gt() 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 qdisc_reset() 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 __qdisc_run+0x133f/0x1760 ... Call Trace: <TASK> ... __qdisc_run+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 QDISCSTATENON_EMPTY after reset so the qdisc state reflects an empty queue, avoiding needless re-scheduling.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23340.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6b3ba9146fe64b9bebb6346c9dcfe3b4851de2d7
Fixed
7594467c49bfc2f4644dee0415ac2290db11fa0d
Fixed
dbd58b0730aa06ab6ad26079cf9a5b6b58e7e750
Fixed
5bc4e69306ed7ae02232eb4c0b23ed621a26d504
Fixed
8314944cc3bdeaa5a73e6f8a8cf0d94822e625cb
Fixed
c69df4e0524f8de8e176ba389acd83e85f5f49d0
Fixed
7f083faf59d14c04e01ec05a7507f036c965acf8

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23340.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.16.0
Fixed
6.1.167
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.130
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.77
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.17
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
6.19.7

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23340.json"