Skip to main content

CVE-2021-47368: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47368cvecve-2021-47368
Published: Tue May 21 2024 (05/21/2024, 15:03:34 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: enetc: Fix illegal access when reading affinity_hint irq_set_affinity_hit() stores a reference to the cpumask_t parameter in the irq descriptor, and that reference can be accessed later from irq_affinity_hint_proc_show(). Since the cpu_mask parameter passed to irq_set_affinity_hit() has only temporary storage (it's on the stack memory), later accesses to it are illegal. Thus reads from the corresponding procfs affinity_hint file can result in paging request oops. The issue is fixed by the get_cpu_mask() helper, which provides a permanent storage for the cpumask_t parameter.

AI-Powered Analysis

AILast updated: 07/03/2025, 05:10:42 UTC

Technical Analysis

CVE-2021-47368 is a high-severity vulnerability in the Linux kernel related to the handling of CPU affinity hints in the enetc network driver. Specifically, the function irq_set_affinity_hit() stores a reference to a cpumask_t parameter in the irq descriptor. However, this cpumask_t parameter is passed as a pointer to stack memory, which is temporary and invalid after the function returns. Later, when irq_affinity_hint_proc_show() attempts to read this stored reference via the procfs affinity_hint file, it accesses invalid memory, leading to illegal memory access and a kernel oops (crash). This vulnerability is essentially a use-after-free or dangling pointer issue caused by improper lifetime management of the cpumask_t structure. The root cause is that the cpu_mask parameter passed to irq_set_affinity_hit() is stored without copying it to permanent memory. The fix involves using the get_cpu_mask() helper function to allocate permanent storage for the cpumask_t parameter, preventing illegal access. The vulnerability affects Linux kernel versions identified by the commit hash d4fd0404c1c95b17880f254ebfee3485693fa8ba and likely related versions before the patch. The CVSS v3.1 base score is 8.1, indicating high severity, with an attack vector of network (AV:N), low attack complexity (AC:L), requiring privileges (PR:L), no user interaction (UI:N), unchanged scope (S:U), high confidentiality impact (C:H), no integrity impact (I:N), and high availability impact (A:H). This means an attacker with some privileges on the system can remotely trigger this vulnerability to cause denial of service by crashing the kernel and potentially exposing sensitive information due to the illegal memory access. There are no known exploits in the wild currently, but the vulnerability is publicly disclosed and patched. The CWE classification is CWE-400, indicating a resource exhaustion or DoS condition. This vulnerability is particularly relevant for Linux systems running the affected kernel versions, especially those using the enetc driver and exposing the procfs affinity_hint interface.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily in terms of availability and confidentiality. Systems running vulnerable Linux kernels with the enetc driver can be crashed remotely or locally by an attacker with limited privileges, leading to denial of service conditions. This can disrupt critical infrastructure, enterprise servers, cloud environments, and network devices relying on Linux. The high confidentiality impact suggests that sensitive kernel memory could be exposed during the illegal access, potentially leaking information useful for further attacks. Organizations in sectors such as finance, telecommunications, government, and critical infrastructure in Europe that rely on Linux-based systems are at risk of operational disruption and data exposure. The requirement for privileges limits the attack surface to insiders or compromised accounts, but the network attack vector means remote exploitation is possible once privileges are obtained. The lack of user interaction requirement facilitates automated exploitation in compromised environments. Given the widespread use of Linux in European data centers, cloud providers, and embedded systems, the impact can be broad if patches are not applied promptly. Additionally, the vulnerability could be leveraged in multi-tenant environments to affect other tenants or services.

Mitigation Recommendations

European organizations should prioritize applying the official Linux kernel patches that address CVE-2021-47368 by incorporating the get_cpu_mask() helper to ensure permanent storage of cpumask_t parameters. Kernel upgrades to the fixed versions or backported patches from trusted Linux distributors should be deployed as soon as possible. Organizations should audit their Linux systems to identify those running affected kernel versions, especially those using the enetc driver and exposing procfs interfaces related to irq affinity. Restricting access to procfs affinity_hint files to trusted users only can reduce exploitation risk. Implementing strict privilege management and monitoring for unusual privilege escalations or access to procfs files can help detect exploitation attempts. Network segmentation and firewall rules should limit access to vulnerable systems to trusted networks and users. In environments where patching is delayed, consider disabling or restricting the enetc driver or procfs affinity_hint interface if feasible. Regular vulnerability scanning and compliance checks should include this CVE to ensure remediation. Finally, maintain up-to-date incident response plans to quickly address potential kernel crashes or DoS incidents stemming from this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T14:58:30.810Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9833c4522896dcbe8f4d

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

Last enriched: 7/3/2025, 5:10:42 AM

Last updated: 7/25/2025, 10:47:06 PM

Views: 10

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