driver core: use READ_ONCE() for dev->driver in dev_has_sync_state()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ac338acf514e7b578fa9e3742ec2c292323b4c1a · < cc77f0d91e3214e4292208f02a1dc09a31f9aac7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
driver core: use READ_ONCE() for dev->driver in dev_has_sync_state()
dev_has_sync_state() reads dev->driver twice without holding device_lock() -- once for the NULL check and once to dereference ->sync_state. Some callers only hold device_links_write_lock, which doesn't prevent a concurrent unbind from clearing dev->driver via device_unbind_cleanup().
Fix it by reading dev->driver exactly once with READ_ONCE(), pairing with the WRITE_ONCE() in device_set_driver().
From the CVE record · Linux
In the Linux kernel driver core, dev_has_sync_state() reads dev->driver twice without holding device_lock(). A concurrent driver unbind can clear that pointer between the reads; the input does not specify an attacker action, access requirements, or user interaction.
Engineers running the Linux kernel should check their builds; affected versions are not specified.