CVE-2026-31688

Source
https://cve.org/CVERecord?id=CVE-2026-31688
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31688.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-31688
Downstream
Related
Published
2026-04-27T17:32:37.892Z
Modified
2026-07-08T08:00:04.635710245Z
Summary
driver core: enforce device_lock for driver_match_device()
Details

In the Linux kernel, the following vulnerability has been resolved:

driver core: enforce devicelock for drivermatch_device()

Currently, drivermatchdevice() is called from three sites. One site (__deviceattachdriver) holds devicelock(dev), but the other two (bindstore and _driverattach) do not. This inconsistency means that bus match() callbacks are not guaranteed to be called with the lock held.

Fix this by introducing drivermatchdevicelocked(), which guarantees holding the device lock using a scoped guard. Replace the unlocked calls in bindstore() and _driverattach() with this new helper. Also add a lock assertion to drivermatchdevice() to enforce this guarantee.

This consistency also fixes a known race condition. The driveroverride implementation relies on the devicelock, so the missing lock led to the use-after-free (UAF) reported in Bugzilla for buses using this field.

Stress testing the two newly locked paths for 24 hours with CONFIGPROVELOCKING and CONFIG_LOCKDEP enabled showed no UAF recurrence and no lockdep warnings.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31688.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
49b420a13ff95b449947181190b08367348e3e1b
Fixed
dc23806a7c47ec5f1293aba407fb69519f976ee0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31688.json"