cve-2024-56695
Vulnerability from cvelistv5
Published
2024-12-28 09:46
Modified
2025-01-20 06:26
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()' The `kfd_get_cu_occupancy` function previously declared a large `cu_occupancy` array as a local variable, which could lead to stack overflows due to excessive stack usage. This commit replaces the static array allocation with dynamic memory allocation using `kcalloc`, thereby reducing the stack size. This change avoids the risk of stack overflows in kernel space, in scenarios where `AMDGPU_MAX_QUEUES` is large. The allocated memory is freed using `kfree` before the function returns to prevent memory leaks. Fixes the below with gcc W=1: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function ‘kfd_get_cu_occupancy’: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=] 322 | } | ^
Impacted products
Vendor Product Version
Linux Linux Version: 6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84
Version: 6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84
Create a notification for this product.
   Linux Linux Version: 6.12
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/amd/amdkfd/kfd_process.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "6d9f07196389f35a3afebcf1a12c1425725caddd",
              "status": "affected",
              "version": "6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84",
              "versionType": "git"
            },
            {
              "lessThan": "922f0e00017b09d9d47e3efac008c8b20ed546a0",
              "status": "affected",
              "version": "6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/amd/amdkfd/kfd_process.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.12"
            },
            {
              "lessThan": "6.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: Use dynamic allocation for CU occupancy array in \u0027kfd_get_cu_occupancy()\u0027\n\nThe `kfd_get_cu_occupancy` function previously declared a large\n`cu_occupancy` array as a local variable, which could lead to stack\noverflows due to excessive stack usage. This commit replaces the static\narray allocation with dynamic memory allocation using `kcalloc`,\nthereby reducing the stack size.\n\nThis change avoids the risk of stack overflows in kernel space,  in\nscenarios where `AMDGPU_MAX_QUEUES` is large. The  allocated memory is\nfreed using `kfree` before the function returns  to prevent memory\nleaks.\n\nFixes the below with gcc W=1:\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function \u2018kfd_get_cu_occupancy\u2019:\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]\n  322 | }\n      | ^"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-01-20T06:26:22.294Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd"
        },
        {
          "url": "https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0"
        }
      ],
      "title": "drm/amdkfd: Use dynamic allocation for CU occupancy array in \u0027kfd_get_cu_occupancy()\u0027",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-56695",
    "datePublished": "2024-12-28T09:46:19.468Z",
    "dateReserved": "2024-12-27T15:00:39.850Z",
    "dateUpdated": "2025-01-20T06:26:22.294Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-56695\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-12-28T10:15:15.533\",\"lastModified\":\"2024-12-28T10:15:15.533\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ndrm/amdkfd: Use dynamic allocation for CU occupancy array in \u0027kfd_get_cu_occupancy()\u0027\\n\\nThe `kfd_get_cu_occupancy` function previously declared a large\\n`cu_occupancy` array as a local variable, which could lead to stack\\noverflows due to excessive stack usage. This commit replaces the static\\narray allocation with dynamic memory allocation using `kcalloc`,\\nthereby reducing the stack size.\\n\\nThis change avoids the risk of stack overflows in kernel space,  in\\nscenarios where `AMDGPU_MAX_QUEUES` is large. The  allocated memory is\\nfreed using `kfree` before the function returns  to prevent memory\\nleaks.\\n\\nFixes the below with gcc W=1:\\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function \u2018kfd_get_cu_occupancy\u2019:\\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]\\n  322 | }\\n      | ^\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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.
  • 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.