drm/amd/display: Use krealloc_array() in dal_vector_reserve()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2004f45ef83f07f43f5da6ede780b08068c7583d · < e09689286385a66311ac6922af95339d7a3cef8d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: Use krealloc_array() in dal_vector_reserve()
[Why & How] dal_vector_reserve() computes the allocation size as "capacity * vector->struct_size" using uint32_t arithmetic, which can silently wrap to a small value on overflow. This would cause krealloc to return a smaller buffer than expected, leading to heap overflows on subsequent vector appends.
Replace krealloc() with krealloc_array() which performs an internal overflow check and returns NULL on wrap, preventing the issue.
(cherry picked from commit 37668568641ccc4cc1dbca4923d0a16609dd5707)
From the CVE record · Linux
The Linux kernel’s AMD display code can overflow a 32-bit allocation-size calculation in dal_vector_reserve(), resulting in a buffer smaller than expected and possible heap overflows on subsequent vector appends. The input does not specify how an attacker could trigger this, whether authentication or user interaction is required, or whether access is local or over a network.
Engineers running Linux kernels with the AMD display component should check their versions; affected versions are not specified.