7.8 CVE-2025-38350

Enriched by CISA Patch
 

In the Linux kernel, the following vulnerability has been resolved: net/sched: Always pass notifications when child class becomes empty Certain classful qdiscs may invoke their classes' dequeue handler on an enqueue operation. This may unexpectedly empty the child qdisc and thus make an in-flight class passive via qlen_notify(). Most qdiscs do not expect such behaviour at this point in time and may re-activate the class eventually anyways which will lead to a use-after-free. The referenced fix commit attempted to fix this behavior for the HFSC case by moving the backlog accounting around, though this turned out to be incomplete since the parent's parent may run into the issue too. The following reproducer demonstrates this use-after-free: tc qdisc add dev lo root handle 1: drr tc filter add dev lo parent 1: basic classid 1:1 tc class add dev lo parent 1: classid 1:1 drr tc qdisc add dev lo parent 1:1 handle 2: hfsc def 1 tc class add dev lo parent 2: classid 2:1 hfsc rt m1 8 d 1 m2 0 tc qdisc add dev lo parent 2:1 handle 3: netem tc qdisc add dev lo parent 3:1 handle 4: blackhole echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888 tc class delete dev lo classid 1:1 echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888 Since backlog accounting issues leading to a use-after-frees on stale class pointers is a recurring pattern at this point, this patch takes a different approach. Instead of trying to fix the accounting, the patch ensures that qdisc_tree_reduce_backlog always calls qlen_notify when the child qdisc is empty. This solves the problem because deletion of qdiscs always involves a call to qdisc_reset() and / or qdisc_purge_queue() which ultimately resets its qlen to 0 thus causing the following qdisc_tree_reduce_backlog() to report to the parent. Note that this may call qlen_notify on passive classes multiple times. This is not a problem after the recent patch series that made all the classful qdiscs qlen_notify() handlers idempotent.
https://nvd.nist.gov/vuln/detail/CVE-2025-38350

Categories

CWE-416 : Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. If the product accesses a previously-freed pointer, then it means that a separate weakness or error already occurred previously, such as a race condition, an unexpected or poorly handled error condition, confusion over which part of the program is responsible for freeing the memory, performing the free too soon, etc. a pointer that no longer points to valid memory, often after it has been freed commonly used acronym for Use After Free Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues. Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.) Use tools that are integrated duringcompilation to insert runtime error-checking mechanismsrelated to memory safety errors, such as AddressSanitizer(ASan) for C/C++ [REF-1518]. Choose a language that provides automatic memory management. When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy. TCP/IP code for an OS has a use-after-free that can leak heap memory contents Chain: an operating system kernel has insufficent resource locking (CWE-413) leading to a use after free (CWE-416). Chain: two threads in a web browser use the same resource (CWE-366), but one of those threads can destroy the resource before the other has completed (CWE-416). Chain: mobile platform race condition (CWE-362) leading to use-after-free (CWE-416), as exploited in the wild per CISA KEV. Chain: race condition (CWE-362) leads to use-after-free (CWE-416), as exploited in the wild per CISA KEV. Use-after-free triggered by closing a connection while data is still being transmitted. Improper allocation for invalid data leads to use-after-free. certificate with a large number of Subject Alternate Names not properly handled in realloc, leading to use-after-free Timers are not disabled when a related object is deleted Access to a "dead" object that is being cleaned up object is deleted even with a non-zero reference count, and later accessed use-after-free involving request containing an invalid version number unload of an object that is currently being accessed by other functionality incorrectly tracking a reference count leads to use-after-free use-after-free related to use of uninitialized memory HTML document with incorrectly-nested tags Use after free in ActiveX object by providing a malformed argument to a method use-after-free by disconnecting during data transfer, or a message containing incorrect data types disconnect during a large data transfer causes incorrect reference count, leading to use-after-free use-after-free found by fuzzing Chain: race condition (CWE-362) from improper handling of a page transition in web client while an applet is loading (CWE-368) leads to use after free (CWE-416) realloc generates new buffer and pointer, but previous pointer is still retained, leading to use after free Use-after-free in web browser, probably resultant from not initializing memory. use-after-free when one thread accessed memory that was freed by another thread assignment of malformed values to certain properties triggers use after free mail server does not properly handle a long header. chain: integer overflow leads to use-after-free freed pointer dereference Chain: A multi-threaded race condition (CWE-367) allows attackers to cause two threads to process the same RPC request, which causes a use-after-free (CWE-416) in one thread

References


 

AFFECTED (from MITRE)


Vendor Product Versions
Linux Linux
  • 1034e3310752e8675e313f7271b348914008719a < 3b290923ad2b23596208c1e29520badef4356a43 [affected]
  • f9f593e34d2fb67644372c8f7b033bdc622ad228 < e9921b57dca05ac5f4fa1fa8e993d4f0ee52e2b7 [affected]
  • 89c301e929a0db14ebd94b4d97764ce1d6981653 < e269f29e9395527bc00c213c6b15da04ebb35070 [affected]
  • f1dde3eb17dc1b8bd07aed00004b1e05fc87a3d4 < 7874c9c132e906a52a187d045995b115973c93fb [affected]
  • 93c276942e75de0e5bc91576300d292e968f5a02 < f680a4643c6f71e758d8fe0431a958e9a6a4f59d [affected]
  • 49b21795b8e5654a7df3d910a12e1060da4c04cf < a553afd91f55ff39b1e8a1c4989a29394c9e0472 [affected]
  • 3f981138109f63232a5fb7165938d4c945cc1b9d < a44acdd9e84a211989ff4b9b92bf3545d8456ad5 [affected]
  • 3f981138109f63232a5fb7165938d4c945cc1b9d < 103406b38c600fec1fe375a77b27d87e314aea09 [affected]
  • 3f3a22eebbc32b4fa8ce9c1d5f9db214b45b9335 [affected]
  • 5.4.294 < 5.4.296 [affected]
  • 5.10.238 < 5.10.240 [affected]
  • 5.15.185 < 5.15.187 [affected]
  • 6.1.141 < 6.1.144 [affected]
  • 6.6.93 < 6.6.97 [affected]
  • 6.12.31 < 6.12.37 [affected]
  • 6.14.9 < 6.15 [affected]
Linux Linux
  • 6.15 [affected]
  • < 6.15 [unaffected]
  • 5.4.296 ≤ 5.4.* [unaffected]
  • 5.10.240 ≤ 5.10.* [unaffected]
  • 5.15.187 ≤ 5.15.* [unaffected]
  • 6.1.144 ≤ 6.1.* [unaffected]
  • 6.6.97 ≤ 6.6.* [unaffected]
  • 6.12.37 ≤ 6.12.* [unaffected]
  • 6.15.6 ≤ 6.15.* [unaffected]
  • 6.16 ≤ * [unaffected]
© 2022 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation.

CPE

cpe start end
Configuration 1
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.4.294 < 5.4.296
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.10.238 < 5.10.240
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.15.185 < 5.15.187
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.1.141 < 6.1.144
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.6.93 < 6.6.97
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.12.31 < 6.12.37
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.14.9 < 6.15
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.15.1 < 6.15.6
cpe:2.3:o:linux:linux_kernel:6.15:-:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc4:*:*:*:*:*:*
Configuration 2
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*


REMEDIATION


Patch

Url
https://git.kernel.org/stable/c/103406b38c600fec1fe375a77b27d87e314aea09
https://git.kernel.org/stable/c/3b290923ad2b23596208c1e29520badef4356a43
https://git.kernel.org/stable/c/7874c9c132e906a52a187d045995b115973c93fb
https://git.kernel.org/stable/c/a44acdd9e84a211989ff4b9b92bf3545d8456ad5
https://git.kernel.org/stable/c/a553afd91f55ff39b1e8a1c4989a29394c9e0472
https://git.kernel.org/stable/c/e269f29e9395527bc00c213c6b15da04ebb35070
https://git.kernel.org/stable/c/e9921b57dca05ac5f4fa1fa8e993d4f0ee52e2b7
https://git.kernel.org/stable/c/f680a4643c6f71e758d8fe0431a958e9a6a4f59d


EXPLOITS


Exploit-db.com

id description date
No known exploits

POC Github

Url
No known exploits

Other Nist (github, ...)

Url
No known exploits


CAPEC


Common Attack Pattern Enumerations and Classifications

id description severity
No entry