iio: light: gp2ap002: Fix unbalanced runtime PM on repeated event writes
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 97d642e23037c5545266f9564c9b81e6db81b122 · < 0fc740c25c9abb25113398ebb58e2f2ce57741a7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: light: gp2ap002: Fix unbalanced runtime PM on repeated event writes
The IIO core does not filter duplicate writes to the event enable attribute, so writing the same value twice invokes write_event_config() twice. Enabling twice leaks a runtime PM reference, preventing the device from ever suspending again; disabling twice underflows the usage count and triggers a "Runtime PM usage count underflow" warning.
Bail out early when the requested state matches the current state. While at it, switch to pm_runtime_resume_and_get() so a failed resume is propagated to userspace instead of silently marking the event enabled.
From the CVE record · Linux
The Linux kernel gp2ap002 light driver mishandles repeated writes to its event-enable attribute. Someone with local access to write that attribute can prevent the device from suspending by enabling it twice, or trigger a runtime power management usage-count warning by disabling it twice.
Engineers running Linux kernels with the gp2ap002 light driver should check their kernel vendor's affected-version information; no versions were provided.