{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-38592","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2024-06-18T19:36:34.930Z","datePublished":"2024-06-19T13:45:43.367Z","dateUpdated":"2026-08-05T11:33:03.299Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T11:33:03.299Z"},"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't\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't 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's suggested to only use the non-initting alloc\nfunctions if you really need to.\n\nLet's switch the function to use an allocation function that zeros the\nmemory. For me, this avoids the crash."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The uninitialized `ddp_comp` slot is only reached through DRM ioctls on `/dev/dri/card*` — `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 — `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 — open the card node, force a connector probe, drive the CRTC enable — 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 `->funcs`, `->funcs->mode_valid` and `->id` from a kernel address the code never validated — 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]->id` into `mtk_mutex_add_comp()`, whose default case computes `mtx->data->mutex_mod[id]` out of bounds and then performs `readl_relaxed()`/`writel_relaxed()` at `mtx->regs + offset` — an out-of-bounds register write driven by uninitialized data. The indirect calls `comp->funcs->mode_valid()`, `->config()` and `->start()` 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 — exactly the crash reported in the fix commit's `mtk_drm_crtc_mode_valid()` loop under `slub_debug=FZPUA` — and the unchecked `comp->funcs` 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":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/mediatek/mtk_drm_crtc.c"],"versions":[{"version":"01389b324c97ff8f04e9c33b9ee246084f9f6dd2","lessThan":"cf69d0af7db917b82aceaa44b7b1b9376609da22","status":"affected","versionType":"git"},{"version":"01389b324c97ff8f04e9c33b9ee246084f9f6dd2","lessThan":"9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1","status":"affected","versionType":"git"},{"version":"01389b324c97ff8f04e9c33b9ee246084f9f6dd2","lessThan":"01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/mediatek/mtk_drm_crtc.c"],"versions":[{"version":"6.7","status":"affected"},{"version":"0","lessThan":"6.7","status":"unaffected","versionType":"semver"},{"version":"6.8.12","lessThanOrEqual":"6.8.*","status":"unaffected","versionType":"semver"},{"version":"6.9.3","lessThanOrEqual":"6.9.*","status":"unaffected","versionType":"semver"},{"version":"6.10","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.8.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.9.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.10"}]}]}],"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"}},"adp":[{"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-06-20T19:44:50.300653Z","id":"CVE-2024-38592","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"title":"CISA ADP Vulnrichment","providerMetadata":{"orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP","dateUpdated":"2024-06-20T19:44:58.390Z"}},{"providerMetadata":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2024-08-02T04:12:25.991Z"},"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"]}]}]}}