Skip to main content

CVE-2021-47280: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47280cvecve-2021-47280
Published: Tue May 21 2024 (05/21/2024, 14:20:06 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drm: Fix use-after-free read in drm_getunique() There is a time-of-check-to-time-of-use error in drm_getunique() due to retrieving file_priv->master prior to locking the device's master mutex. An example can be seen in the crash report of the use-after-free error found by Syzbot: https://syzkaller.appspot.com/bug?id=148d2f1dfac64af52ffd27b661981a540724f803 In the report, the master pointer was used after being freed. This is because another process had acquired the device's master mutex in drm_setmaster_ioctl(), then overwrote fpriv->master in drm_new_set_master(). The old value of fpriv->master was subsequently freed before the mutex was unlocked. To fix this, we lock the device's master mutex before retrieving the pointer from from fpriv->master. This patch passes the Syzbot reproducer test.

AI-Powered Analysis

AILast updated: 06/26/2025, 11:23:46 UTC

Technical Analysis

CVE-2021-47280 is a use-after-free vulnerability identified in the Linux kernel's Direct Rendering Manager (DRM) subsystem, specifically within the drm_getunique() function. The root cause is a time-of-check-to-time-of-use (TOCTOU) race condition arising from accessing the file_priv->master pointer before acquiring the device's master mutex lock. This improper synchronization allows a scenario where the master pointer can be freed by another thread or process that acquires the master mutex and modifies the pointer concurrently. The vulnerability was discovered through Syzbot, an automated kernel fuzzer, which produced a crash report demonstrating the use-after-free condition. The issue occurs because drm_setmaster_ioctl() can acquire the master mutex and call drm_new_set_master(), which overwrites the fpriv->master pointer and frees the old master object before releasing the mutex. Meanwhile, drm_getunique() reads the master pointer without holding the mutex, leading to a stale pointer dereference. The fix involves locking the device's master mutex before accessing the master pointer in drm_getunique(), ensuring proper synchronization and preventing the use-after-free. This patch has been validated by passing the Syzbot reproducer test. The vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and likely other versions prior to the patch. No known exploits are reported in the wild as of the publication date (May 21, 2024).

Potential Impact

The vulnerability could allow local attackers or processes with access to the DRM device interfaces to trigger a use-after-free condition, potentially leading to kernel crashes (denial of service) or, in a worst-case scenario, privilege escalation or arbitrary code execution within the kernel context. For European organizations, this poses a risk primarily to systems running vulnerable Linux kernel versions with DRM enabled, which are common in servers, desktops, and embedded devices using Linux graphics subsystems. The impact on confidentiality and integrity could be significant if exploited to escalate privileges or execute arbitrary code, compromising sensitive data or system stability. Availability could also be affected due to kernel panics or crashes. However, exploitation requires local access and interaction with the DRM subsystem, limiting remote attack vectors. The absence of known exploits in the wild reduces immediate risk but does not eliminate the threat, especially in environments with unpatched Linux systems. Critical infrastructure, cloud providers, and enterprises relying on Linux-based systems for graphics or compute workloads could be impacted if not patched promptly.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to the patched version that includes the fix for CVE-2021-47280. Specifically, ensure that all systems running DRM-enabled kernels are upgraded to versions incorporating the mutex locking fix in drm_getunique(). For environments where immediate patching is not feasible, consider restricting access to DRM device files (e.g., /dev/dri/*) to trusted users only, minimizing the risk of local exploitation. Employ kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and Kernel Page Table Isolation (KPTI) to reduce the impact of potential kernel exploits. Regularly audit and monitor kernel logs for unusual crashes or anomalies related to DRM operations. Additionally, implement strict access controls and user privilege management to prevent unauthorized local access to vulnerable interfaces. Finally, maintain an up-to-date inventory of Linux kernel versions deployed across the organization to identify and remediate vulnerable systems efficiently.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T13:27:52.128Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea2ce

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

Last enriched: 6/26/2025, 11:23:46 AM

Last updated: 8/16/2025, 4:14:35 PM

Views: 9

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