7.8high
arch_topology: Avoid use-after-free for scale_freq_data
- Severity
- 7.8high CVSS:3.1 by NVD
- Exploit likelihood
- 0.23% (higher than 14% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: arch_topology: Avoid use-after-free for scale_freq_data Currently topology_scale_freq_tick() (which gets called from scheduler_tick()) may end up using a pointer to "struct scale_freq_data", which was previously cleared by topology_clear_scale_freq_source(), as there is no protection in place here. The users of topology_clear_scale_freq_source() though needs a guarantee that the previously cleared scale_freq_data isn't used anymore, so they can free the related resources. Since topology_scale_freq_tick() is called from scheduler tick, we don't want to add locking in there. Use the RCU update mechanism instead (which is already used by the scheduler's utilization update path) to guarantee race free updates here. synchronize_rcu() makes sure that all RCU critical sections that started before it is called, will finish before it returns. And so the callers of topology_clear_scale_freq_source() don't need to worry about their callback getting called anymore.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 01e055c120a46e78650b5f903088badbbdaae9ad before ccdf7e073170886bc370c613e269de610a794c4a, from 01e055c120a46e78650b5f903088badbbdaae9ad before 83150f5d05f065fb5c12c612f119015cabdcc124, 5.13 Not affected: before 5.13, from 5.13.4 up to 5.13.*, from 5.14 up to * | CVE List |
| linux linux_kernel | from 5.13 before 5.13.4 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: arch_topology: Avoid use-after-free for scale_freq_data Currently topology_scale_freq_tick() (which gets called from scheduler_tick()) may end up using a pointer to "struct scale_freq_data", which was previously cleared by topology_clear_scale_freq_source(), as there is no protection in place here. The users of topology_clear_scale_freq_source() though needs a guarantee that the previously cleared scale_freq_data isn't used anymore, so they can free the related resources. Since topology_scale_freq_tick() is called from scheduler tick, we don't want to add locking in there. Use the RCU update mechanism instead (which is already used by the scheduler's utilization update path) to guarantee race free updates here. synchronize_rcu() makes sure that all RCU critical sections that started before it is called, will finish before it returns. And so the callers of topology_clear_scale_freq_source() don't need to worry about their callback getting called anymore.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: arch_topology: Evite el use after free para scale_freq_data. Actualmente, topology_scale_freq_tick() (que se llama desde Scheduler_tick()) puede terminar usando un puntero a "struct scale_freq_data", que anteriormente era borrado por topology_clear_scale_freq_source(), ya que no existe ninguna protección aquí. Sin embargo, los usuarios de topology_clear_scale_freq_source() necesitan una garantía de que el scale_freq_data previamente borrado ya no se utiliza, para que puedan liberar los recursos relacionados. Dado que topology_scale_freq_tick() se llama desde el tick del programador, no queremos agregar bloqueo allí. Utilice en su lugar el mecanismo de actualización de RCU (que ya se utiliza en la ruta de actualización de utilización del programador) para garantizar actualizaciones sin ejecucións aquí. sincronizar_rcu() se asegura de que todas las secciones críticas de RCU que comenzaron antes de ser llamada terminen antes de que regrese. Y así, las personas que llaman a topology_clear_scale_freq_source() ya no necesitan preocuparse de que se llame a su devolución de llamada.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-47318 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2021-47318 changed 2026-06-17 | Public domain |