7.0high
cdx: Fix possible UAF error in driver_override_show()
- Severity
- 7.0high CVSS:3.1 by Linux
- Exploit likelihood
- 0.23% (higher than 15% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: cdx: Fix possible UAF error in driver_override_show() Fixed a possible UAF problem in driver_override_show() in drivers/cdx/cdx.c This function driver_override_show() is part of DEVICE_ATTR_RW, which includes both driver_override_show() and driver_override_store(). These functions can be executed concurrently in sysfs. The driver_override_store() function uses driver_set_override() to update the driver_override value, and driver_set_override() internally locks the device (device_lock(dev)). If driver_override_show() reads cdx_dev->driver_override without locking, it could potentially access a freed pointer if driver_override_store() frees the string concurrently. This could lead to printing a kernel address, which is a security risk since DEVICE_ATTR can be read by all users. Additionally, a similar pattern is used in drivers/amba/bus.c, as well as many other bus drivers, where device_lock() is taken in the show function, and it has been working without issues. This potential bug was detected by our experimental static analysis tool, which analyzes locking APIs and paired functions to identify data races and atomicity violations.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 2959ab247061e67485d83b6af8feb3761ec08cb9 before d7b339bbc887bcfc1a5b620bfc70c6fbb8f733bf, from 2959ab247061e67485d83b6af8feb3761ec08cb9 before 8473135f89c0949436a22adb05b8cece2fb3da91, from 2959ab247061e67485d83b6af8feb3761ec08cb9 before 0439d541aa8d3444ad41c39e39eb71acb57acde3, from 2959ab247061e67485d83b6af8feb3761ec08cb9 before 91d44c1afc61a2fec37a9c7a3485368309391e0b, 6.4 Not affected: before 6.4, from 6.6.83 up to 6.6.*, from 6.12.19 up to 6.12.*, from 6.13.7 up to 6.13.*, from 6.14 up to * | CVE List |
| linux linux_kernel | from 6.4 before 6.6.83, from 6.7 before 6.12.19, from 6.13 before 6.13.7, 6.14 | NVD |
All scores
| Linux | 7.0high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA-ADP | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
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: cdx: Fix possible UAF error in driver_override_show() Fixed a possible UAF problem in driver_override_show() in drivers/cdx/cdx.c This function driver_override_show() is part of DEVICE_ATTR_RW, which includes both driver_override_show() and driver_override_store(). These functions can be executed concurrently in sysfs. The driver_override_store() function uses driver_set_override() to update the driver_override value, and driver_set_override() internally locks the device (device_lock(dev)). If driver_override_show() reads cdx_dev->driver_override without locking, it could potentially access a freed pointer if driver_override_store() frees the string concurrently. This could lead to printing a kernel address, which is a security risk since DEVICE_ATTR can be read by all users. Additionally, a similar pattern is used in drivers/amba/bus.c, as well as many other bus drivers, where device_lock() is taken in the show function, and it has been working without issues. This potential bug was detected by our experimental static analysis tool, which analyzes locking APIs and paired functions to identify data races and atomicity violations.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: cdx: Se corrige un posible error de UAF en driver_override_show() Se corrigió un posible problema de UAF en driver_override_show() en drivers/cdx/cdx.c Esta función driver_override_show() es parte de DEVICE_ATTR_RW, que incluye tanto driver_override_show() como driver_override_store(). Estas funciones se pueden ejecutar simultáneamente en sysfs. La función driver_override_store() usa driver_set_override() para actualizar el valor de driver_override, y driver_set_override() bloquea internamente el dispositivo (device_lock(dev)). Si driver_override_show() lee cdx_dev->driver_override sin bloquear, podría acceder potencialmente a un puntero liberado si driver_override_store() libera la cadena simultáneamente. Esto podría llevar a imprimir una dirección del kernel, lo cual es un riesgo de seguridad ya que DEVICE_ATTR puede ser leído por todos los usuarios. Además, se utiliza un patrón similar en drivers/amba/bus.c, así como en muchos otros controladores de bus, donde device_lock() se utiliza en la función show y ha funcionado sin problemas. Este posible error fue detectado por nuestra herramienta experimental de análisis estático, que analiza las API de bloqueo y las funciones emparejadas para identificar carreras de datos y violaciones de atomicidad.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-21915 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2025-21915 changed 2026-07-30 | Public domain |