CVE-2024-53192 (GCVE-0-2024-53192)
Vulnerability from cvelistv5
Published
2024-12-27 13:49
Modified
2026-08-05 11:44
Summary
In the Linux kernel, the following vulnerability has been resolved: clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access Flexible-array member `hws` in `struct clk_hw_onecell_data` is annotated with the `counted_by()` attribute. This means that when memory is allocated for this array, the _counter_, which in this case is member `num` in the flexible structure, should be set to the maximum number of elements the flexible array can contain, or fewer. In this case, the total number of elements for the flexible array is determined by variable `clks_num` when allocating heap space via `devm_kzalloc()`, as shown below: 289 struct loongson2_clk_provider *clp; ... 296 for (p = data; p->name; p++) 297 clks_num++; 298 299 clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num), 300 GFP_KERNEL); So, `clp->clk_data.num` should be set to `clks_num` or less, and not exceed `clks_num`, as is currently the case. Otherwise, if data is written into `clp->clk_data.hws[clks_num]`, the instrumentation provided by the compiler won't detect the overflow, leading to a memory corruption bug at runtime. Fix this issue by setting `clp->clk_data.num` to `clks_num`.
Impacted products
Vendor Product Version
Linux Linux Version: 9796ec0bd04bb0e70487127d44949ca0554df5d3
Version: 9796ec0bd04bb0e70487127d44949ca0554df5d3
Version: 9796ec0bd04bb0e70487127d44949ca0554df5d3
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 5.5,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "NONE",
              "integrityImpact": "NONE",
              "privilegesRequired": "LOW",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-53192",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-02-18T16:03:52.402922Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "cweId": "CWE-120",
                "description": "CWE-120 Buffer Copy without Checking Size of Input (\u0027Classic Buffer Overflow\u0027)",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-02-18T16:06:09.354Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/clk/clk-loongson2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "b96fc194984d0c82de1ca2b4166b35b1298b216c",
              "status": "affected",
              "version": "9796ec0bd04bb0e70487127d44949ca0554df5d3",
              "versionType": "git"
            },
            {
              "lessThan": "1bf8877150128c3abd9d233886a05f6966fbf0c7",
              "status": "affected",
              "version": "9796ec0bd04bb0e70487127d44949ca0554df5d3",
              "versionType": "git"
            },
            {
              "lessThan": "02fb4f0084331ef72c28d0c70fcb15d1bea369ec",
              "status": "affected",
              "version": "9796ec0bd04bb0e70487127d44949ca0554df5d3",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/clk/clk-loongson2.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.10"
            },
            {
              "lessThan": "6.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.11.*",
              "status": "unaffected",
              "version": "6.11.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.11.11",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.2",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13",
                  "versionStartIncluding": "6.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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-\u003ename; p++)\n297                 clks_num++;\n298\n299         clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),\n300                            GFP_KERNEL);\n\nSo, `clp-\u003eclk_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-\u003eclk_data.hws[clks_num]`, the instrumentation\nprovided by the compiler won\u0027t detect the overflow, leading to a\nmemory corruption bug at runtime.\n\nFix this issue by setting `clp-\u003eclk_data.num` to `clks_num`."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The affected code is an SoC clock-controller platform driver reached only through in-kernel probe/clock-lookup paths on the local system; there is no network- or peer-facing input. Local access to the device (Loongson-2K embedded/industrial boards) is the applicable vector.\nAC:L - The off-by-one counter is unconditional and deterministic \u2014 no race, no timing window, and no memory-layout luck is needed for index `clks_num` to slip past both the `__counted_by` instrumentation and the `of_clk_hw_onecell_get()` bound check.\nPR:L - No capability or privilege check exists anywhere on the affected path (`of_clk_get* \u2192 __of_clk_get_hw_from_provider \u2192 of_clk_hw_onecell_get`); the weakened bound is exercised by ordinary clock consumers. Between low and high privileges the more severe value is taken.\nUI:N - The out-of-range access occurs autonomously during driver probe and clock-provider resolution; no victim action is required.\nS:U - Corruption and disclosure stay within the kernel\u0027s own memory and security authority \u2014 no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `of_clk_hw_onecell_get()` returns `hws[clks_num]`, a pointer read beyond the `devm_kzalloc()` allocation, exposing adjacent slab contents that are then dereferenced as a `struct clk_hw` \u2014 an out-of-bounds read leveragable for kernel memory disclosure.\nI:H - The inflated `num` disables the compiler\u0027s `counted_by` overflow detection, so a store to `hws[clks_num]` writes a kernel pointer into the neighbouring heap object undetected, and the OOB-read pointer is subsequently written through via `kref_get(\u0026core-\u003eref)` \u2014 a controlled-value out-of-bounds write primitive.\nA:H - Dereferencing the out-of-bounds `clk_hw` pointer (`hw-\u003ecore`, `core-\u003eowner`) or corrupting the adjacent slab object reliably produces an oops or panic, and it happens at boot/probe time so the system fails to come up."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:44:32.673Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/b96fc194984d0c82de1ca2b4166b35b1298b216c"
        },
        {
          "url": "https://git.kernel.org/stable/c/1bf8877150128c3abd9d233886a05f6966fbf0c7"
        },
        {
          "url": "https://git.kernel.org/stable/c/02fb4f0084331ef72c28d0c70fcb15d1bea369ec"
        }
      ],
      "title": "clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-53192",
    "datePublished": "2024-12-27T13:49:34.608Z",
    "dateReserved": "2024-11-19T17:17:25.013Z",
    "dateUpdated": "2026-08-05T11:44:32.673Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.5, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"NONE\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-53192\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-02-18T16:03:52.402922Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-120\", \"description\": \"CWE-120 Buffer Copy without Checking Size of Input (\u0027Classic Buffer Overflow\u0027)\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-02-18T16:03:53.766Z\"}}], \"cna\": {\"title\": \"clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"9796ec0bd04bb0e70487127d44949ca0554df5d3\", \"lessThan\": \"b96fc194984d0c82de1ca2b4166b35b1298b216c\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"9796ec0bd04bb0e70487127d44949ca0554df5d3\", \"lessThan\": \"1bf8877150128c3abd9d233886a05f6966fbf0c7\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"9796ec0bd04bb0e70487127d44949ca0554df5d3\", \"lessThan\": \"02fb4f0084331ef72c28d0c70fcb15d1bea369ec\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/clk/clk-loongson2.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.10\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.10\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.11.11\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.11.*\"}, {\"status\": \"unaffected\", \"version\": \"6.12.2\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.12.*\"}, {\"status\": \"unaffected\", \"version\": \"6.13\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/clk/clk-loongson2.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/b96fc194984d0c82de1ca2b4166b35b1298b216c\"}, {\"url\": \"https://git.kernel.org/stable/c/1bf8877150128c3abd9d233886a05f6966fbf0c7\"}, {\"url\": \"https://git.kernel.org/stable/c/02fb4f0084331ef72c28d0c70fcb15d1bea369ec\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"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-\u003ename; p++)\\n297                 clks_num++;\\n298\\n299         clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),\\n300                            GFP_KERNEL);\\n\\nSo, `clp-\u003eclk_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-\u003eclk_data.hws[clks_num]`, the instrumentation\\nprovided by the compiler won\u0027t detect the overflow, leading to a\\nmemory corruption bug at runtime.\\n\\nFix this issue by setting `clp-\u003eclk_data.num` to `clks_num`.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.11.11\", \"versionStartIncluding\": \"6.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.12.2\", \"versionStartIncluding\": \"6.10\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.13\", \"versionStartIncluding\": \"6.10\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T09:55:24.466Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-53192\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T09:55:24.466Z\", \"dateReserved\": \"2024-11-19T17:17:25.013Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-12-27T13:49:34.608Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…