drm/msm/a6xx: Fix kvzalloc vs state_kcalloc usage
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/msm/a6xx: Fix kvzalloc vs state_kcalloc usage
adreno_show_object() is a trap! It will re-allocate the pointer it is passed on first call, when the data is ascii85 encoded, using kvmalloc/ kvfree(). Which means the data *passed* to it must be kvmalloc'd, ie. we cannot use the state_kcalloc() helper.
This partially reverts commit ec8f1813bf8d ("drm/msm/a6xx: Replace kcalloc() with kvzalloc()"), but adds the missing kvfree() to fix the memory leak that was present previously. And adds a warning comment.
Patchwork: https://patchwork.freedesktop.org/patch/507014/
From the CVE record · Linux
The Linux kernel's drm/msm/a6xx code passes an allocation to adreno_show_object() that is incompatible with how the function reallocates and frees it during ascii85 encoding. The input does not specify the resulting attacker impact or whether exploitation requires local access, authentication, or user interaction.
Engineers running Linux kernels with drm/msm/a6xx should check whether their kernel includes the fix; affected versions are not specified.