CVE-2024-38592

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-38592
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-38592.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-38592
Downstream
Related
Published
2024-06-19T13:45:43Z
Modified
2025-10-17T07:36:06.211009Z
Summary
drm/mediatek: Init `ddp_comp` with devm_kcalloc()
Details

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 mtkdrmcrtccreate() 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 mtkdrmcrtcmode_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.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Fixed
cf69d0af7db917b82aceaa44b7b1b9376609da22
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Fixed
9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
01389b324c97ff8f04e9c33b9ee246084f9f6dd2
Fixed
01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33

Affected versions

v6.*

v6.6
v6.6-rc2
v6.6-rc3
v6.6-rc4
v6.6-rc5
v6.6-rc6
v6.6-rc7
v6.7
v6.7-rc1
v6.7-rc2
v6.7-rc3
v6.7-rc4
v6.7-rc5
v6.7-rc6
v6.7-rc7
v6.7-rc8
v6.8
v6.8-rc1
v6.8-rc2
v6.8-rc3
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.8.1
v6.8.10
v6.8.11
v6.8.2
v6.8.3
v6.8.4
v6.8.5
v6.8.6
v6.8.7
v6.8.8
v6.8.9
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7
v6.9.1
v6.9.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.8.12
Type
ECOSYSTEM
Events
Introduced
6.9.0
Fixed
6.9.3