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.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b304362ce836968b803e5d4c5f84dcb51a7bf0f2",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"138849662499887878602425398041240107017",
"37260001998583601124958965542262380829",
"291883683430541086614136644776362227827",
"288531239673569107122764034067088777752"
]
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c"
},
"id": "CVE-2024-53076-329e562c"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@62c11896683129790b8f5ab6eb7e695818b0b723",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "269932584383089937981024355089664840259",
"length": 1097.0
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c",
"function": "iio_gts_build_avail_scale_table"
},
"id": "CVE-2024-53076-3cde5dad"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@62c11896683129790b8f5ab6eb7e695818b0b723",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"138849662499887878602425398041240107017",
"37260001998583601124958965542262380829",
"291883683430541086614136644776362227827",
"288531239673569107122764034067088777752"
]
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c"
},
"id": "CVE-2024-53076-6d5a93f4"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b304362ce836968b803e5d4c5f84dcb51a7bf0f2",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "269932584383089937981024355089664840259",
"length": 1097.0
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c",
"function": "iio_gts_build_avail_scale_table"
},
"id": "CVE-2024-53076-7cda2078"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@369f05688911b05216cfcd6ca74473bec87948d7",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "281021699146628314043178491316847755266",
"length": 1176.0
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c",
"function": "iio_gts_build_avail_scale_table"
},
"id": "CVE-2024-53076-abfd7385"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@369f05688911b05216cfcd6ca74473bec87948d7",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"138849662499887878602425398041240107017",
"37260001998583601124958965542262380829",
"291883683430541086614136644776362227827",
"288531239673569107122764034067088777752"
]
},
"target": {
"file": "drivers/iio/industrialio-gts-helper.c"
},
"id": "CVE-2024-53076-adbbe4d3"
}
]