iio: dac: m62332: Fix regulator reference count imbalance
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b87b0c0f81e8d11c881b726b886b7502ab67d884 · < 08ac8d2976d57aa943d64e351c4d0bd8bb0c6de9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: dac: m62332: Fix regulator reference count imbalance
m62332_set_value() enables the Vcc regulator on every write of a non-zero value and disables it on every write of zero, without tracking the channel's current state. Because the regulator is reference counted, changing a channel directly from one non-zero value to another enables it more than once, while a later write of zero disables it only once. The reference count never returns to zero and the regulator is left enabled indefinitely.
Only enable the regulator on the transition from zero to non-zero, and only disable it on the transition from non-zero to zero, using the previously stored channel value to detect the edge. Balance the regulator on the I2C error path so the reference count stays consistent if the write fails.
From the CVE record · Linux
The m62332 DAC driver can leave its Vcc regulator enabled indefinitely after a channel is changed between non-zero values and then set to zero. This requires writes to the affected channel; the input does not describe an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the m62332 DAC driver should check their kernel version; affected versions are not specified.