{"id":"CVE-2024-53192","aliases":["CVE-2024-53192"],"related":[],"kind":"vulnerability","state":"published","title":"clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: clk-loongson2: Fix potential buffer overflow in flexible-array member access\n\nFlexible-array member `hws` in `struct clk_hw_onecell_data` is annotated\nwith the `counted_by()` attribute. This means that when memory is\nallocated for this array, the _counter_, which in this case is member\n`num` in the flexible structure, should be set to the maximum number of\nelements the flexible array can contain, or fewer.\n\nIn this case, the total number of elements for the flexible array is\ndetermined by variable `clks_num` when allocating heap space via\n`devm_kzalloc()`, as shown below:\n\n289         struct loongson2_clk_provider *clp;\n\t...\n296         for (p = data; p->name; p++)\n297                 clks_num++;\n298\n299         clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),\n300                            GFP_KERNEL);\n\nSo, `clp->clk_data.num` should be set to `clks_num` or less, and not\nexceed `clks_num`, as is currently the case. Otherwise, if data is\nwritten into `clp->clk_data.hws[clks_num]`, the instrumentation\nprovided by the compiler won't detect the overflow, leading to a\nmemory corruption bug at runtime.\n\nFix this issue by setting `clp->clk_data.num` to `clks_num`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: clk-loongson2: Fix potential buffer overflow in flexible-array member access\n\nFlexible-array member `hws` in `struct clk_hw_onecell_data` is annotated\nwith the `counted_by()` attribute. This means that when memory is\nallocated for this array, the _counter_, which in this case is member\n`num` in the flexible structure, should be set to the maximum number of\nelements the flexible array can contain, or fewer.\n\nIn this case, the total number of elements for the flexible array is\ndetermined by variable `clks_num` when allocating heap space via\n`devm_kzalloc()`, as shown below:\n\n289         struct loongson2_clk_provider *clp;\n\t...\n296         for (p = data; p->name; p++)\n297                 clks_num++;\n298\n299         clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),\n300                            GFP_KERNEL);\n\nSo, `clp->clk_data.num` should be set to `clks_num` or less, and not\nexceed `clks_num`, as is currently the case. Otherwise, if data is\nwritten into `clp->clk_data.hws[clks_num]`, the instrumentation\nprovided by the compiler won't detect the overflow, leading to a\nmemory corruption bug at runtime.\n\nFix this issue by setting `clp->clk_data.num` to `clks_num`.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: clk: clk-loongson2: Se corrige un desbordamiento de búfer potencial en el acceso a miembros de la matriz flexible El miembro de la matriz flexible `hws` en `struct clk_hw_onecell_data` está anotado con el atributo `counted_by()`. Esto significa que cuando se asigna memoria para esta matriz, el _contador_, que en este caso es el miembro `num` en la estructura flexible, se debe establecer en el número máximo de elementos que la matriz flexible puede contener, o menos. En este caso, el número total de elementos para la matriz flexible se determina mediante la variable `clks_num` al asignar espacio de montón a través de `devm_kzalloc()`, como se muestra a continuación: 289 struct loongson2_clk_provider *clp; ... 296 for (p = data; p-&gt;name; p++) 297 clks_num++; 298 299 clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num), 300 GFP_KERNEL); Por lo tanto, `clp-&gt;clk_data.num` debe establecerse en `clks_num` o menos, y no superar `clks_num`, como es el caso actualmente. De lo contrario, si los datos se escriben en `clp-&gt;clk_data.hws[clks_num]`, la instrumentación proporcionada por el compilador no detectará el desbordamiento, lo que provocará un error de corrupción de memoria en tiempo de ejecución. Solucione este problema estableciendo `clp-&gt;clk_data.num` en `clks_num`.","source":"nvd"}],"published":"2024-12-27T13:49:34.608Z","modified":"2026-08-05T11:44:32.673Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-120"],"affected":[{"ranges":[{"type":"git","introduced":"9796ec0bd04bb0e70487127d44949ca0554df5d3","fixed":"b96fc194984d0c82de1ca2b4166b35b1298b216c","status":"affected"},{"type":"git","introduced":"9796ec0bd04bb0e70487127d44949ca0554df5d3","fixed":"1bf8877150128c3abd9d233886a05f6966fbf0c7","status":"affected"},{"type":"git","introduced":"9796ec0bd04bb0e70487127d44949ca0554df5d3","fixed":"02fb4f0084331ef72c28d0c70fcb15d1bea369ec","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.10","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.10","status":"unaffected"},{"type":"semver","introduced":"6.11.11","lastAffected":"6.11.*","status":"unaffected"},{"type":"semver","introduced":"6.12.2","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.10","fixed":"6.11.11"},{"status":"affected","introduced":"6.12","fixed":"6.12.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/b96fc194984d0c82de1ca2b4166b35b1298b216c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1bf8877150128c3abd9d233886a05f6966fbf0c7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/02fb4f0084331ef72c28d0c70fcb15d1bea369ec","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-02-18T16:03:52.402Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-53192","url":"https://www.cve.org/CVERecord?id=CVE-2024-53192","licence":"CVE Terms of Use","modified":"2026-08-05T11:44:32.673Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-53192","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53192","licence":"Public domain","modified":"2026-08-04T11:22:03.973Z"}],"updatedAt":"2026-11-25T22:58:50.408Z","epss":{"score":0.00242,"percentile":0.16419,"date":"2026-12-01T12:00:22.000Z"}}