cve-2024-38592
Vulnerability from cvelistv5
Published
2024-06-19 13:45
Modified
2024-08-02 04:12
Severity
Summary
drm/mediatek: Init `ddp_comp` with devm_kcalloc()
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-38592",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-20T19:44:50.300653Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-20T19:44:58.390Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T04:12:25.991Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/mediatek/mtk_drm_crtc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "cf69d0af7db9",
              "status": "affected",
              "version": "01389b324c97",
              "versionType": "git"
            },
            {
              "lessThan": "9fe2cc3fa44f",
              "status": "affected",
              "version": "01389b324c97",
              "versionType": "git"
            },
            {
              "lessThan": "01a2c5123e27",
              "status": "affected",
              "version": "01389b324c97",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/gpu/drm/mediatek/mtk_drm_crtc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.7"
            },
            {
              "lessThan": "6.7",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.12",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.3",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/mediatek: Init `ddp_comp` with devm_kcalloc()\n\nIn the case where `conn_routes` is true we allocate an extra slot in\nthe `ddp_comp` array but mtk_drm_crtc_create() never seemed to\ninitialize it in the test case I ran. For me, this caused a later\ncrash when we looped through the array in mtk_drm_crtc_mode_valid().\nThis showed up for me when I booted with `slub_debug=FZPUA` which\npoisons the memory initially. Without `slub_debug` I couldn\u0027t\nreproduce, presumably because the later code handles the value being\nNULL and in most cases (not guaranteed in all cases) the memory the\nallocator returned started out as 0.\n\nIt really doesn\u0027t hurt to initialize the array with devm_kcalloc()\nsince the array is small and the overhead of initting a handful of\nelements to 0 is small. In general initting memory to zero is a safer\npractice and usually it\u0027s suggested to only use the non-initting alloc\nfunctions if you really need to.\n\nLet\u0027s switch the function to use an allocation function that zeros the\nmemory. For me, this avoids the crash."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-07-15T06:48:40.195Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22"
        },
        {
          "url": "https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1"
        },
        {
          "url": "https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33"
        }
      ],
      "title": "drm/mediatek: Init `ddp_comp` with devm_kcalloc()",
      "x_generator": {
        "engine": "bippy-c9c4e1df01b2"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-38592",
    "datePublished": "2024-06-19T13:45:43.367Z",
    "dateReserved": "2024-06-18T19:36:34.930Z",
    "dateUpdated": "2024-08-02T04:12:25.991Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-38592\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-06-19T14:15:19.297\",\"lastModified\":\"2024-06-20T12:44:01.637\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ndrm/mediatek: Init `ddp_comp` with devm_kcalloc()\\n\\nIn the case where `conn_routes` is true we allocate an extra slot in\\nthe `ddp_comp` array but mtk_drm_crtc_create() never seemed to\\ninitialize it in the test case I ran. For me, this caused a later\\ncrash when we looped through the array in mtk_drm_crtc_mode_valid().\\nThis showed up for me when I booted with `slub_debug=FZPUA` which\\npoisons the memory initially. Without `slub_debug` I couldn\u0027t\\nreproduce, presumably because the later code handles the value being\\nNULL and in most cases (not guaranteed in all cases) the memory the\\nallocator returned started out as 0.\\n\\nIt really doesn\u0027t hurt to initialize the array with devm_kcalloc()\\nsince the array is small and the overhead of initting a handful of\\nelements to 0 is small. In general initting memory to zero is a safer\\npractice and usually it\u0027s suggested to only use the non-initting alloc\\nfunctions if you really need to.\\n\\nLet\u0027s switch the function to use an allocation function that zeros the\\nmemory. For me, this avoids the crash.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: drm/mediatek: Init `ddp_comp` con devm_kcalloc() En el caso de que `conn_routes` sea verdadero, asignamos una ranura adicional en la matriz `ddp_comp` pero mtk_drm_crtc_create() nunca apareci\u00f3 para inicializarlo en el caso de prueba que ejecut\u00e9. Para m\u00ed, esto provoc\u00f3 un bloqueo posterior cuando recorrimos la matriz en mtk_drm_crtc_mode_valid(). Esto me apareci\u00f3 cuando arranqu\u00e9 con `slub_debug=FZPUA` que envenena la memoria inicialmente. Sin `slub_debug` no pude reproducir, presumiblemente porque el c\u00f3digo posterior maneja que el valor sea NULL y en la mayor\u00eda de los casos (no garantizado en todos los casos) la memoria que devolvi\u00f3 el asignador comenz\u00f3 como 0. Realmente no est\u00e1 de m\u00e1s inicializar el array con devm_kcalloc() ya que la matriz es peque\u00f1a y la sobrecarga de iniciar un pu\u00f1ado de elementos en 0 es peque\u00f1a. En general, iniciar la memoria a cero es una pr\u00e1ctica m\u00e1s segura y, por lo general, se sugiere usar solo las funciones de asignaci\u00f3n que no son de inicio si realmente es necesario. Cambiemos la funci\u00f3n para usar una funci\u00f3n de asignaci\u00f3n que ponga a cero la memoria. Para m\u00ed, esto evita el accidente.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...