Skip to main content

CVE-2021-47200: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47200cvecve-2021-47200
Published: Wed Apr 10 2024 (04/10/2024, 18:56:35 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drm/prime: Fix use after free in mmap with drm_gem_ttm_mmap drm_gem_ttm_mmap() drops a reference to the gem object on success. If the gem object's refcount == 1 on entry to drm_gem_prime_mmap(), that drop will free the gem object, and the subsequent drm_gem_object_get() will be a UAF. Fix by grabbing a reference before calling the mmap helper. This issue was forseen when the reference dropping was adding in commit 9786b65bc61ac ("drm/ttm: fix mmap refcounting"): "For that to work properly the drm_gem_object_get() call in drm_gem_ttm_mmap() must be moved so it happens before calling obj->funcs->mmap(), otherwise the gem refcount would go down to zero."

AI-Powered Analysis

AILast updated: 06/26/2025, 17:06:25 UTC

Technical Analysis

CVE-2021-47200 is a use-after-free (UAF) vulnerability in the Linux kernel's Direct Rendering Manager (DRM) subsystem, specifically within the drm_gem_ttm_mmap() function. The vulnerability arises due to improper reference counting of gem objects during memory mapping operations. When drm_gem_ttm_mmap() is called, it drops a reference to the gem object upon success. If the gem object's reference count is exactly one at the time drm_gem_prime_mmap() is entered, this reference drop frees the gem object prematurely. Subsequently, a call to drm_gem_object_get() attempts to access this freed object, resulting in a use-after-free condition. This flaw stems from a sequencing error introduced in commit 9786b65bc61ac, where the call to drm_gem_object_get() was not moved before the mmap helper function call, causing the reference count to drop to zero too early. Exploiting this vulnerability could allow an attacker with the ability to trigger the mmap operation to execute arbitrary code, cause kernel crashes, or escalate privileges by manipulating kernel memory. The flaw is subtle and relates to kernel memory management and reference counting in graphics memory objects, which are critical for secure and stable operation of the Linux graphics stack.

Potential Impact

For European organizations, the impact of CVE-2021-47200 depends largely on the deployment of vulnerable Linux kernel versions in their infrastructure, especially in systems utilizing DRM for graphics processing such as workstations, servers with GPU acceleration, or embedded devices. Successful exploitation could lead to denial of service via kernel crashes or potentially privilege escalation, undermining system integrity and availability. This is particularly concerning for sectors relying on Linux for critical operations, including finance, manufacturing, research institutions, and government agencies. The vulnerability could be leveraged by local attackers or malicious software to gain elevated privileges or disrupt services. While no known exploits are reported in the wild, the complexity of the flaw and its location in kernel memory management suggest that skilled attackers could develop reliable exploits, increasing risk over time if unpatched. The confidentiality of data could also be at risk if attackers gain kernel-level access, enabling them to bypass security controls and access sensitive information.

Mitigation Recommendations

Mitigation requires applying the official Linux kernel patches that correct the reference counting order in drm_gem_ttm_mmap(). Organizations should: 1) Identify all Linux systems running affected kernel versions, particularly those with DRM and TTM subsystems enabled. 2) Prioritize patching or upgrading to kernel versions where this vulnerability is fixed. 3) For systems where immediate patching is not feasible, restrict untrusted users from accessing DRM devices or performing mmap operations on graphics memory objects. 4) Employ kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR), Kernel Page Table Isolation (KPTI), and seccomp filters to reduce exploitation likelihood. 5) Monitor system logs and kernel messages for unusual activity related to DRM or mmap calls. 6) Engage in vulnerability management processes to track updates from Linux kernel maintainers and security advisories. These steps go beyond generic advice by focusing on the specific subsystem and operation involved in the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-03-25T09:12:14.117Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea02c

Added to database: 5/21/2025, 9:09:09 AM

Last enriched: 6/26/2025, 5:06:25 PM

Last updated: 8/15/2025, 2:07:49 AM

Views: 11

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats