Skip to main content

CVE-2021-47068: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47068cvecve-2021-47068
Published: Thu Feb 29 2024 (02/29/2024, 22:37:41 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net/nfc: fix use-after-free llcp_sock_bind/connect Commits 8a4cd82d ("nfc: fix refcount leak in llcp_sock_connect()") and c33b1cc62 ("nfc: fix refcount leak in llcp_sock_bind()") fixed a refcount leak bug in bind/connect but introduced a use-after-free if the same local is assigned to 2 different sockets. This can be triggered by the following simple program: int sock1 = socket( AF_NFC, SOCK_STREAM, NFC_SOCKPROTO_LLCP ); int sock2 = socket( AF_NFC, SOCK_STREAM, NFC_SOCKPROTO_LLCP ); memset( &addr, 0, sizeof(struct sockaddr_nfc_llcp) ); addr.sa_family = AF_NFC; addr.nfc_protocol = NFC_PROTO_NFC_DEP; bind( sock1, (struct sockaddr*) &addr, sizeof(struct sockaddr_nfc_llcp) ) bind( sock2, (struct sockaddr*) &addr, sizeof(struct sockaddr_nfc_llcp) ) close(sock1); close(sock2); Fix this by assigning NULL to llcp_sock->local after calling nfc_llcp_local_put. This addresses CVE-2021-23134.

AI-Powered Analysis

AILast updated: 07/03/2025, 05:55:14 UTC

Technical Analysis

CVE-2021-47068 is a high-severity use-after-free vulnerability in the Linux kernel's NFC (Near Field Communication) subsystem, specifically affecting the Logical Link Control Protocol (LLCP) socket binding and connection functions. The vulnerability originated from a fix for a reference count leak in the llcp_sock_bind() and llcp_sock_connect() functions, which inadvertently introduced a use-after-free condition when the same local NFC address is assigned to two different sockets. The flaw can be triggered by creating two AF_NFC SOCK_STREAM sockets using the NFC_SOCKPROTO_LLCP protocol, binding both sockets to the same local NFC address, and then closing them. Due to improper handling of the local socket reference after releasing it (nfc_llcp_local_put), the kernel attempts to access freed memory, leading to potential memory corruption. This can result in arbitrary code execution, kernel crashes, or privilege escalation. The vulnerability is tracked under CWE-416 (Use After Free) and has a CVSS v3.1 score of 7.8, indicating high severity, with attack vector local, low attack complexity, requiring low privileges, no user interaction, and impacting confidentiality, integrity, and availability. The fix involves assigning NULL to the llcp_sock->local pointer after releasing the reference to prevent use-after-free. No known exploits are currently reported in the wild, but the vulnerability affects multiple Linux kernel versions identified by specific commit hashes. This vulnerability is critical for systems using NFC features, especially those relying on LLCP sockets for NFC communication.

Potential Impact

For European organizations, the impact of CVE-2021-47068 depends largely on the deployment of Linux systems with NFC capabilities. Organizations in sectors such as manufacturing, logistics, transportation, and retail that utilize NFC for device communication, access control, or payment systems could be at risk. Exploitation could allow local attackers or malicious insiders to execute arbitrary code in kernel context, leading to full system compromise, data breaches, or denial of service. This is particularly concerning for critical infrastructure and industrial control systems that may use Linux-based embedded devices with NFC. The vulnerability's ability to compromise confidentiality, integrity, and availability could disrupt business operations and lead to regulatory non-compliance under GDPR if personal data is affected. Although exploitation requires local access and low privileges, compromised endpoints or insider threats could leverage this flaw to escalate privileges and move laterally within networks. The absence of known exploits in the wild reduces immediate risk but does not eliminate the threat, especially as proof-of-concept code is straightforward to implement.

Mitigation Recommendations

European organizations should prioritize patching Linux kernel versions affected by this vulnerability as soon as updates become available. Since the vulnerability requires local access, organizations should also enforce strict access controls and limit user privileges on systems with NFC capabilities. Disabling NFC functionality on Linux systems where it is not required can reduce the attack surface. For systems that must use NFC, implement monitoring for unusual socket operations or kernel anomalies indicative of exploitation attempts. Employ kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR), and enable security modules like SELinux or AppArmor to restrict process capabilities. Regularly audit and update device firmware and drivers related to NFC hardware. Additionally, conduct user awareness training to mitigate insider threats and ensure that endpoint security solutions are configured to detect suspicious local activity. Finally, maintain an inventory of Linux systems with NFC enabled to ensure comprehensive coverage of patching and mitigation efforts.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-29T22:33:44.296Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe9c23

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

Last enriched: 7/3/2025, 5:55:14 AM

Last updated: 8/11/2025, 4:03:41 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