7.8high
net/sched: cls_route: fix fastmap use-after-free on filter
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.18% (higher than 7% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: net/sched: cls_route: fix fastmap use-after-free on filter The route4 classifier maintains a 16-slot fastmap cache that stores raw struct route4_filter pointers indexed by (id, iif). The reader (route4_classify) populates this cache via route4_set_fastmap() for every classified packet that hits a filter. The writer (route4_delete, route4_change) clears the cache via route4_reset_fastmap() before RCU-deferred kfree of the filter. This creates a UAF race: 1. Reader walks the RCU-protected bucket chain, finds filter f 2. Writer unlinks f, calls route4_reset_fastmap(), then tcf_queue_work() 3. Reader calls route4_set_fastmap() and writes f into the cache *after* the writer's reset, caching a pointer about to be freed 4. After the RCU grace period, kfree(f) executes 5. Next classified packet on the same (id, iif) tuple hits the stale fastmap entry and reads f->res from freed memory Reproduced with an mdelay(100) accelerator in route4_set_fastmap() and a concurrent add/delete stress test (provided by both zdi and Santosh). Both triggered KASAN slab-use-after-free reports in the route4 fastmap paths. Fix: Introduce a per-filter boolean dying flag to suppress stale fastmap republishing by in-flight readers.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 1109c00547fc66df45b9ff923544be4c1e1bec13 before 7897198b26445b4009a057bda1986b94a99e5d5f, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before 820f083c294ad6d319c02a7d43294f2ed2565139, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before 5ec9001be6d0eb527251125632ec8fe88278897f, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before b969984b2bdc85d721ce4047cd270cd37ec705a2, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before a17f636c9330eac879822ce29f998e5abd1b72c1, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before 0e7a8cf8895b06d07c7311f028eba16ad742b9bc, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before ae9aff87025219005a2d16b4fe83d6f24643e50d, from 1109c00547fc66df45b9ff923544be4c1e1bec13 before 47d7f7051253bdc02b1d245d87e38f16d31a74df and 1 more Not affected: before 3.18, from 5.10.265 up to 5.10.*, from 5.15.216 up to 5.15.*, from 6.1.183 up to 6.1.*, from 6.6.152 up to 6.6.*, from 6.12.104 up to 6.12.* | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: net/sched: cls_route: fix fastmap use-after-free on filter The route4 classifier maintains a 16-slot fastmap cache that stores raw struct route4_filter pointers indexed by (id, iif). The reader (route4_classify) populates this cache via route4_set_fastmap() for every classified packet that hits a filter. The writer (route4_delete, route4_change) clears the cache via route4_reset_fastmap() before RCU-deferred kfree of the filter. This creates a UAF race: 1. Reader walks the RCU-protected bucket chain, finds filter f 2. Writer unlinks f, calls route4_reset_fastmap(), then tcf_queue_work() 3. Reader calls route4_set_fastmap() and writes f into the cache *after* the writer's reset, caching a pointer about to be freed 4. After the RCU grace period, kfree(f) executes 5. Next classified packet on the same (id, iif) tuple hits the stale fastmap entry and reads f->res from freed memory Reproduced with an mdelay(100) accelerator in route4_set_fastmap() and a concurrent add/delete stress test (provided by both zdi and Santosh). Both triggered KASAN slab-use-after-free reports in the route4 fastmap paths. Fix: Introduce a per-filter boolean dying flag to suppress stale fastmap republishing by in-flight readers.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: net/sched: cls_route: corrección de uso después de liberación de fastmap en el filtro El clasificador route4 mantiene una caché fastmap de 16 ranuras que almacena punteros brutos de struct route4_filter indexados por (id, iif). El lector (route4_classify) rellena esta caché a través de route4_set_fastmap() para cada paquete clasificado que coincide con un filtro. El escritor (route4_delete, route4_change) borra la caché a través de route4_reset_fastmap() antes de la liberación kfree diferida por RCU del filtro. Esto crea una condición de carrera UAF: 1. El lector recorre la cadena de cubos protegida por RCU, encuentra el filtro f 2. El escritor desvincula f, llama a route4_reset_fastmap(), luego tcf_queue_work() 3. El lector llama a route4_set_fastmap() y escribe f en la caché después del reinicio del escritor, almacenando en caché un puntero que está a punto de ser liberado 4. Después del período de gracia de RCU, se ejecuta kfree(f) 5. El siguiente paquete clasificado en la misma tupla (id, iif) accede a la entrada fastmap obsoleta y lee f -> res de memoria liberada Reproducido con un acelerador mdelay(100) en route4_set_fastmap() y una prueba de estrés concurrente de añadir/eliminar (proporcionada tanto por zdi como por Santosh). Ambos activaron informes de uso después de liberación de slab de KASAN en las rutas fastmap de route4. Solución: Introducir un indicador booleano 'dying' por filtro para suprimir la republicación de fastmap obsoleta por parte de lectores en curso.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-74583 changed 2026-10-16 | CVE Terms of Use |
| NVD | CVE-2026-74583 changed 2026-10-16 | Public domain |