Memory Leak in drm/imx: imx_pd_connector_get_modes
Summary
GSD-2022-1002401: drm/imx: Fix memory leak in imx_pd_connector_get_modes. Affects Kernel versions >= 76ecd9c9fb24b014a6f33fbb1287ede3be12158b, < 38bf605bd8c83d942c8dcffaef3633b7d8b37549. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The drm/imx package is a component of the Linux Kernel that provides support for display controllers found in i.MX SoCs. It enables the management and configuration of display modes for devices using these controllers. The imx_pd_connector_get_modes function is responsible for retrieving the available display modes for a given connector. However, a memory leak vulnerability has been identified in this function.
Vulnerability Detail
The memory leak vulnerability in imx_pd_connector_get_modes arises from a failure to release allocated memory when an error condition occurs during mode retrieval. This can result in a gradual depletion of system memory over time, leading to performance degradation or even system instability. An attacker with access to this vulnerability could potentially exploit it to exhaust system resources, causing denial of service (DoS) conditions.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can apply the patch provided in commit 38bf605bd8c83d942c8dcffaef3633b7d8b37549 manually. The patch modifies the imx_pd_connector_get_modes function to properly release allocated memory in error scenarios. Here is an example of the modified code:
void imx_pd_connector_get_modes(struct drm_connector *connector)
{
// Existing code
...
// Patched code
if (error_condition) {
drm_mode_probed_add(connector, mode);
} else {
kfree(mode);
}
}
Conclusion
In conclusion, the memory leak vulnerability in drm/imx's imx_pd_connector_get_modes function can result in a gradual depletion of system memory, potentially leading to performance degradation or system instability. It is crucial to update the Linux Kernel to version v4.14.276 or later to fix this vulnerability. Alternatively, users can apply the provided patch manually. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can lead to a gradual depletion of system memory, potentially causing performance degradation or system instability. An attacker could exploit this vulnerability to exhaust system resources and cause denial of service (DoS) conditions.
You can use the Vulert Playground at Vulert Scanner to check if your system is affected by this vulnerability. Simply upload your package-lock.json file, and Vulert will analyze it in real-time to identify any open-source vulnerabilities, including this memory leak issue.
Yes, the vulnerability has been fixed in Linux Kernel version v4.14.276. It is recommended to update your Linux Kernel to this version or later to ensure the memory leak is resolved.
Yes, a workaround is available. You can manually apply the patch provided in commit 38bf605bd8c83d942c8dcffaef3633b7d8b37549. This patch modifies the imx_pd_connector_get_modes function to properly release allocated memory in error scenarios.
You can find more information about this vulnerability, including the commit details and affected versions, in the vulnerability database entry at https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1002xxx/GSD-2022-1002401.json.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.