iio: adc: tsc2046: fix memory corruption by preventing array overflow
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 |
|
|
5.15.265.16.125.17In the Linux kernel, the following vulnerability has been resolved:
iio: adc: tsc2046: fix memory corruption by preventing array overflow
On one side we have indio_dev->num_channels includes all physical channels + timestamp channel. On other side we have an array allocated only for physical channels. So, fix memory corruption by ARRAY_SIZE() instead of num_channels variable.
Note the first case is a cleanup rather than a fix as the software timestamp channel bit in active_scanmask is never set by the IIO core.
From the CVE record · Linux
The Linux kernel’s tsc2046 ADC driver can overflow an array allocated for physical channels because it uses a channel count that also includes the timestamp channel. This can cause memory corruption; the input does not establish how an attacker could trigger it or whether authentication or user interaction is required.
Engineers running Linux kernels with the tsc2046 ADC driver should check their versions against the vendor advisory; affected versions are not specified.