iio: gts-helper: Fix memory leaks for the error path of iio_gts_build_avail_scale_table()
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 |
|
|
6.6.606.11.76.12In the Linux kernel, the following vulnerability has been resolved:
iio: gts-helper: Fix memory leaks for the error path of iio_gts_build_avail_scale_table()
If per_time_scales[i] or per_time_gains[i] kcalloc fails in the for loop of iio_gts_build_avail_scale_table(), the err_free_out will fail to call kfree() each time when i is reduced to 0, so all the per_time_scales[0] and per_time_gains[0] will not be freed, which will cause memory leaks.
Fix it by checking if i >= 0.
From the CVE record · Linux
The Linux kernel's iio gts-helper can leak memory if an allocation fails while building an available scale table. The input does not establish whether an attacker can trigger this condition, or specify access, authentication, or user-interaction requirements.
Engineers running the Linux kernel should check whether their version includes the fix; affected versions are not specified.