In the Linux kernel, the following vulnerability has been resolved:
iio: gts-helper: Fix memory leaks for the error path of iiogtsbuildavailscale_table()
If pertimescales[i] or pertimegains[i] kcalloc fails in the for loop of iiogtsbuildavailscaletable(), the errfreeout will fail to call kfree() each time when i is reduced to 0, so all the pertimescales[0] and pertime_gains[0] will not be freed, which will cause memory leaks.
Fix it by checking if i >= 0.
[ { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b304362ce836968b803e5d4c5f84dcb51a7bf0f2", "signature_version": "v1", "target": { "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "138849662499887878602425398041240107017", "37260001998583601124958965542262380829", "291883683430541086614136644776362227827", "288531239673569107122764034067088777752" ] }, "id": "CVE-2024-53076-329e562c" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@62c11896683129790b8f5ab6eb7e695818b0b723", "signature_version": "v1", "target": { "function": "iio_gts_build_avail_scale_table", "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "function_hash": "269932584383089937981024355089664840259", "length": 1097.0 }, "id": "CVE-2024-53076-3cde5dad" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@62c11896683129790b8f5ab6eb7e695818b0b723", "signature_version": "v1", "target": { "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "138849662499887878602425398041240107017", "37260001998583601124958965542262380829", "291883683430541086614136644776362227827", "288531239673569107122764034067088777752" ] }, "id": "CVE-2024-53076-6d5a93f4" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b304362ce836968b803e5d4c5f84dcb51a7bf0f2", "signature_version": "v1", "target": { "function": "iio_gts_build_avail_scale_table", "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "function_hash": "269932584383089937981024355089664840259", "length": 1097.0 }, "id": "CVE-2024-53076-7cda2078" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@369f05688911b05216cfcd6ca74473bec87948d7", "signature_version": "v1", "target": { "function": "iio_gts_build_avail_scale_table", "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "function_hash": "281021699146628314043178491316847755266", "length": 1176.0 }, "id": "CVE-2024-53076-abfd7385" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@369f05688911b05216cfcd6ca74473bec87948d7", "signature_version": "v1", "target": { "file": "drivers/iio/industrialio-gts-helper.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "138849662499887878602425398041240107017", "37260001998583601124958965542262380829", "291883683430541086614136644776362227827", "288531239673569107122764034067088777752" ] }, "id": "CVE-2024-53076-adbbe4d3" } ]