CVE-2025-21915

cdx: Fix possible UAF error in driver_override_show()

High · published April 1, 2025

CVSS v3.1
7.8
EPSS
0%
Percentile
9.8
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00203 · 9.8th percentile
Published
2025-04-01T15:40Z
EPSS history
Timeline
  • 01 APR 15:40Z
    cdx: Fix possible UAF error in driver_override_show()
    cvelistv5