leds: trigger: Unregister sysfs attributes before calling deactivate()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a7e7a3156300a7e1982b03cc9cb8fb0c86434c49 · < cb8aa9d2a4c8a15d6a43ccf901ef3d094aa60374| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
leds: trigger: Unregister sysfs attributes before calling deactivate()
Triggers which have trigger specific sysfs attributes typically store related data in trigger-data allocated by the activate() callback and freed by the deactivate() callback.
Calling device_remove_groups() after calling deactivate() leaves a window where the sysfs attributes show/store functions could be called after deactivation and then operate on the just freed trigger-data.
Move the device_remove_groups() call to before deactivate() to close this race window.
This also makes the deactivation path properly do things in reverse order of the activation path which calls the activate() callback before calling device_add_groups().
From the CVE record · Linux
The Linux kernel removes LED trigger-specific sysfs attributes after deactivating the trigger, creating a race in which attribute handlers can access freed trigger data. Someone able to access those sysfs attributes could trigger the use-after-free during deactivation; the input does not specify authentication requirements or further impact.
Engineers running Linux kernels with LED triggers that expose trigger-specific sysfs attributes should check their versions; affected versions are not specified.