# CVE-2024-38592: drm/mediatek: Init `ddp_comp` with devm_kcalloc()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-06-19T13:45:43.367Z
- Modified: 2026-08-05T11:33:03.299Z
- Weaknesses: CWE-908
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 01389b324c97ff8f04e9c33b9ee246084f9f6dd2 before cf69d0af7db917b82aceaa44b7b1b9376609da22; from 01389b324c97ff8f04e9c33b9ee246084f9f6dd2 before 9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1; from 01389b324c97ff8f04e9c33b9ee246084f9f6dd2 before 01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33; 6.7 (not affected: before 6.7; from 6.8.12 up to 6.8.*; from 6.9.3 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 6.7 before 6.8.12; from 6.9 before 6.9.3

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22> (patch)
- <https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1> (patch)
- <https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33> (patch)

## Sources

- CVE List: [CVE-2024-38592](https://www.cve.org/CVERecord?id=CVE-2024-38592), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2024-38592](https://nvd.nist.gov/vuln/detail/CVE-2024-38592), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2024-38592 · Whole record: https://cve.day/CVE-2024-38592.json · Rebuilt by cve.day 2026-11-25T22:58:42.032Z
