CVE-2026-98680: iio: accel: kionix-kx022a: Prevent memory leak and fix state
In the Linux kernel, the following vulnerability has been resolved:
iio: accel: kionix-kx022a: Prevent memory leak and fix state
The driver allocates memory for samples at buffer enable path. If regmap operation fails in the kx022afifoenable() at the buffer enable path, the allocated memory is never freed. Furthermore, the state information and previous hardware configuration(s) aren't undone, potentially leaving WMI interrupts and buffers enabled, or driver state flags wrong.
Free the memory and revert the hardware configuration and state flags on error path.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In kx022a_fifo_enable() error handling, free the allocated sample memory and restore the previous hardware configuration and driver state flags, including disabling any WMI interrupts and buffers that were enabled.
Event History
Frequently Asked Questions
Under what conditions can this issue occur?
The issue occurs when the Kionix KX022A accelerometer driver's buffer enable path allocates sample memory and a subsequent regmap operation in kx022a_fifo_enable() fails.
What is the impact of a failed buffer enable operation?
Allocated sample memory may not be freed. The driver can also retain incorrect state or hardware configuration, potentially leaving WMI interrupts or buffers enabled and state flags incorrect.
What should be done if the affected error path is encountered?
The corrective behavior is to free the allocated memory and revert prior hardware configuration and driver state flags when the enable-path operation fails.