CVE-2024-38592CWE-908

CVE-2024-38592

High · published June 19, 2024

CVSS v3.1
7.8
EPSS
0%
Percentile
13.5
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00234 · 13.5th percentile
Weakness
CWE-908 · Use of Uninitialized Resource
Published
2024-06-19T18:15Z
Affected products (2)
ProductVersionsFixed in
linux/linux_kernel≥ 6.7, < 6.8.126.8.12
linux/linux_kernel≥ 6.9, < 6.9.36.9.3
References (6)
EPSS history
Timeline
  • 19 JUN 13:45Z
    drm/mediatek: Init `ddp_comp` with devm_kcalloc()
    cvelistv5