iio: adc: ad4851: fix ad4858 chan pointer handling
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:
iio: adc: ad4851: fix ad4858 chan pointer handling
The pointer returned from ad4851_parse_channels_common() is incremented internally as each channel is populated. In ad4858_parse_channels(), the same pointer was further incremented while setting ext_scan_type fields for each channel. This resulted in indio_dev->channels being set to a pointer past the end of the allocated array, potentially causing memory corruption or undefined behavior.
Fix this by iterating over the channels using an explicit index instead of incrementing the pointer. This preserves the original base pointer and ensures all channel metadata is set correctly.
From the CVE record · Linux
The Linux kernel’s ad4858 ADC channel handling can set the channel pointer past the end of an allocated array, potentially causing memory corruption or undefined behavior. The input does not establish how an attacker could trigger this or whether access or user interaction is required.
Engineers running Linux kernels with the ad4858 ADC driver should check their installations; affected versions are not specified.