driver core: fix potential NULL pointer dereference in dev_uevent()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
driver core: fix potential NULL pointer dereference in dev_uevent()
If userspace reads "uevent" device attribute at the same time as another threads unbinds the device from its driver, change to dev->driver from a valid pointer to NULL may result in crash. Fix this by using READ_ONCE() when fetching the pointer, and take bus' drivers klist lock to make sure driver instance will not disappear while we access it.
Use WRITE_ONCE() when setting the driver pointer to ensure there is no tearing.
From the CVE record · Linux
A race in the Linux kernel’s dev_uevent() can cause a NULL pointer dereference. A local userspace read of a device’s uevent attribute can trigger a crash if another thread unbinds the device from its driver at the same time; authentication requirements are not specified.
Anyone running the Linux kernel should check whether their version is affected; affected versions are not specified.