CVE-2025-21915

cdx: Fix possible UAF error in driver_override_show()

State
Published
Severity
7.0 High
Published
Apr 1, 2025
Updated
Aug 5, 2026
Reserved
Dec 29, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.0 HighCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • 2959ab247061e67485d83b6af8feb3761ec08cb9 to before d7b339bbc887bcfc1a5b620bfc70c6fbb8f733bfAffected
  • 2959ab247061e67485d83b6af8feb3761ec08cb9 to before 8473135f89c0949436a22adb05b8cece2fb3da91Affected
  • 2959ab247061e67485d83b6af8feb3761ec08cb9 to before 0439d541aa8d3444ad41c39e39eb71acb57acde3Affected
  • 2959ab247061e67485d83b6af8feb3761ec08cb9 to before 91d44c1afc61a2fec37a9c7a3485368309391e0bAffected
LinuxLinux
  • 6.4Affected
  • before 6.4Not affected
  • 6.6.83 through 6.6.*Not affected
  • 6.12.19 through 6.12.*Not affected
  • 6.13.7 through 6.13.*Not affected
  • 6.14 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.