CVE-2024-38592 (GCVE-0-2024-38592)
Vulnerability from cvelistv5
Published
2024-06-19 13:45
Modified
2026-08-05 11:33
Summary
In the Linux kernel, the following vulnerability has been resolved: drm/mediatek: Init `ddp_comp` with devm_kcalloc() In the case where `conn_routes` is true we allocate an extra slot in the `ddp_comp` array but mtk_drm_crtc_create() never seemed to initialize it in the test case I ran. For me, this caused a later crash when we looped through the array in mtk_drm_crtc_mode_valid(). This showed up for me when I booted with `slub_debug=FZPUA` which poisons the memory initially. Without `slub_debug` I couldn't reproduce, presumably because the later code handles the value being NULL and in most cases (not guaranteed in all cases) the memory the allocator returned started out as 0. It really doesn't hurt to initialize the array with devm_kcalloc() since the array is small and the overhead of initting a handful of elements to 0 is small. In general initting memory to zero is a safer practice and usually it's suggested to only use the non-initting alloc functions if you really need to. Let's switch the function to use an allocation function that zeros the memory. For me, this avoids the crash.
Impacted products
Vendor Product Version
Linux Linux Version: 01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Version: 01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Version: 01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Create a notification for this product.
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": "cf69d0af7db917b82aceaa44b7b1b9376609da22",
              "status": "affected",
              "version": "01389b324c97ff8f04e9c33b9ee246084f9f6dd2",
              "versionType": "git"
            },
            {
              "lessThan": "9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1",
              "status": "affected",
              "version": "01389b324c97ff8f04e9c33b9ee246084f9f6dd2",
              "versionType": "git"
            },
            {
              "lessThan": "01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33",
              "status": "affected",
              "version": "01389b324c97ff8f04e9c33b9ee246084f9f6dd2",
              "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": "semver"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.8.12",
                  "versionStartIncluding": "6.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.9.3",
                  "versionStartIncluding": "6.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.10",
                  "versionStartIncluding": "6.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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."
        }
      ],
      "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 uninitialized `ddp_comp` slot is only reached through DRM ioctls on `/dev/dri/card*` \u2014 `DRM_IOCTL_MODE_GETCONNECTOR` forcing a re-probe into `mtk_drm_crtc_mode_valid()`, or an atomic modeset reaching `mtk_crtc_ddp_hw_init()`. No network, adjacent-network, or physical-bus handler touches this MediaTek display path.\nAC:L - The out-of-range slot is read unconditionally on every pass because `ddp_comp_nr` was incremented past the initialized entries, so `mtk_drm_crtc_mode_valid()`, `mtk_crtc_ddp_clk_enable()` and `mtk_crtc_ddp_hw_init()` consume it deterministically with no race window or timing dependency. An attacker who can open the DRM node re-triggers the read at will by repeatedly issuing GETCONNECTOR with `count_modes == 0` and by cycling the CRTC enable path.\nPR:L - Only an open file descriptor on `/dev/dri/card0` is needed \u2014 `DRM_IOCTL_MODE_GETCONNECTOR` is registered with flags `0` (no `DRM_AUTH`/`DRM_MASTER`/root gate), and a process opening the primary node while no compositor holds mastership is made DRM master automatically, so the force-probe and modeset paths are available to an ordinary local user in the graphics/seat group with no capability check.\nUI:N - The attacker performs the whole sequence itself \u2014 open the card node, force a connector probe, drive the CRTC enable \u2014 with no victim action such as plugging in a display or logging in. The same code path also executes unattended during boot-time fbdev/DRM-client probing.\nS:U - The wild dereference, the out-of-bounds `mutex_mod[]` index and the resulting MMIO access all occur inside the same kernel that contains the MediaTek DRM driver, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - `mtk_ddp_comp_mode_valid()` and `mtk_crtc_ddp_hw_init()` dereference a `struct mtk_ddp_comp *` made of uninitialized slab bytes, reading `-\u003efuncs`, `-\u003efuncs-\u003emode_valid` and `-\u003eid` from a kernel address the code never validated \u2014 an unbounded read of arbitrary kernel memory whose result steers a function-pointer call, and where the stale slab contents can be groomed this becomes a controllable arbitrary-read primitive rather than a fixed leak.\nI:H - `mtk_crtc_ddp_hw_init()` feeds the garbage `ddp_comp[i]-\u003eid` into `mtk_mutex_add_comp()`, whose default case computes `mtx-\u003edata-\u003emutex_mod[id]` out of bounds and then performs `readl_relaxed()`/`writel_relaxed()` at `mtx-\u003eregs + offset` \u2014 an out-of-bounds register write driven by uninitialized data. The indirect calls `comp-\u003efuncs-\u003emode_valid()`, `-\u003econfig()` and `-\u003estart()` through the same uninitialized pointer are a direct control-flow-hijack primitive whenever the stale heap contents can be influenced.\nA:H - Dereferencing the uninitialized pointer oopses the kernel \u2014 exactly the crash reported in the fix commit\u0027s `mtk_drm_crtc_mode_valid()` loop under `slub_debug=FZPUA` \u2014 and the unchecked `comp-\u003efuncs` accesses in `mtk_ddp_comp_clk_enable()`/`_config()`/`_start()` fault on a NULL or wild slot, taking down the display pipeline and panicking the system."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:33:03.299Z",
        "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-1.2.0"
      }
    }
  },
  "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": "2026-08-05T11:33:03.299Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"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\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T04:12:25.991Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-38592\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-06-20T19:44:50.300653Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-06-20T19:44:54.736Z\"}}], \"cna\": {\"title\": \"drm/mediatek: Init `ddp_comp` with devm_kcalloc()\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.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\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The uninitialized `ddp_comp` slot is only reached through DRM ioctls on `/dev/dri/card*` \\u2014 `DRM_IOCTL_MODE_GETCONNECTOR` forcing a re-probe into `mtk_drm_crtc_mode_valid()`, or an atomic modeset reaching `mtk_crtc_ddp_hw_init()`. No network, adjacent-network, or physical-bus handler touches this MediaTek display path.\\nAC:L - The out-of-range slot is read unconditionally on every pass because `ddp_comp_nr` was incremented past the initialized entries, so `mtk_drm_crtc_mode_valid()`, `mtk_crtc_ddp_clk_enable()` and `mtk_crtc_ddp_hw_init()` consume it deterministically with no race window or timing dependency. An attacker who can open the DRM node re-triggers the read at will by repeatedly issuing GETCONNECTOR with `count_modes == 0` and by cycling the CRTC enable path.\\nPR:L - Only an open file descriptor on `/dev/dri/card0` is needed \\u2014 `DRM_IOCTL_MODE_GETCONNECTOR` is registered with flags `0` (no `DRM_AUTH`/`DRM_MASTER`/root gate), and a process opening the primary node while no compositor holds mastership is made DRM master automatically, so the force-probe and modeset paths are available to an ordinary local user in the graphics/seat group with no capability check.\\nUI:N - The attacker performs the whole sequence itself \\u2014 open the card node, force a connector probe, drive the CRTC enable \\u2014 with no victim action such as plugging in a display or logging in. The same code path also executes unattended during boot-time fbdev/DRM-client probing.\\nS:U - The wild dereference, the out-of-bounds `mutex_mod[]` index and the resulting MMIO access all occur inside the same kernel that contains the MediaTek DRM driver, with no crossing of a VM, IOMMU, or sandbox boundary.\\nC:H - `mtk_ddp_comp_mode_valid()` and `mtk_crtc_ddp_hw_init()` dereference a `struct mtk_ddp_comp *` made of uninitialized slab bytes, reading `-\u003efuncs`, `-\u003efuncs-\u003emode_valid` and `-\u003eid` from a kernel address the code never validated \\u2014 an unbounded read of arbitrary kernel memory whose result steers a function-pointer call, and where the stale slab contents can be groomed this becomes a controllable arbitrary-read primitive rather than a fixed leak.\\nI:H - `mtk_crtc_ddp_hw_init()` feeds the garbage `ddp_comp[i]-\u003eid` into `mtk_mutex_add_comp()`, whose default case computes `mtx-\u003edata-\u003emutex_mod[id]` out of bounds and then performs `readl_relaxed()`/`writel_relaxed()` at `mtx-\u003eregs + offset` \\u2014 an out-of-bounds register write driven by uninitialized data. The indirect calls `comp-\u003efuncs-\u003emode_valid()`, `-\u003econfig()` and `-\u003estart()` through the same uninitialized pointer are a direct control-flow-hijack primitive whenever the stale heap contents can be influenced.\\nA:H - Dereferencing the uninitialized pointer oopses the kernel \\u2014 exactly the crash reported in the fix commit\u0027s `mtk_drm_crtc_mode_valid()` loop under `slub_debug=FZPUA` \\u2014 and the unchecked `comp-\u003efuncs` accesses in `mtk_ddp_comp_clk_enable()`/`_config()`/`_start()` fault on a NULL or wild slot, taking down the display pipeline and panicking the system.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"01389b324c97ff8f04e9c33b9ee246084f9f6dd2\", \"lessThan\": \"cf69d0af7db917b82aceaa44b7b1b9376609da22\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"01389b324c97ff8f04e9c33b9ee246084f9f6dd2\", \"lessThan\": \"9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"01389b324c97ff8f04e9c33b9ee246084f9f6dd2\", \"lessThan\": \"01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/gpu/drm/mediatek/mtk_drm_crtc.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.7\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.7\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.8.12\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9.3\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.9.*\"}, {\"status\": \"unaffected\", \"version\": \"6.10\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/gpu/drm/mediatek/mtk_drm_crtc.c\"], \"defaultStatus\": \"affected\"}], \"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\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"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.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.8.12\", \"versionStartIncluding\": \"6.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.9.3\", \"versionStartIncluding\": \"6.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.10\", \"versionStartIncluding\": \"6.7\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:33:03.299Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-38592\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:33:03.299Z\", \"dateReserved\": \"2024-06-18T19:36:34.930Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-06-19T13:45:43.367Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


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…