Skip to main content

CVE-2021-47459: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47459cvecve-2021-47459
Published: Wed May 22 2024 (05/22/2024, 06:23:21 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: can: j1939: j1939_netdev_start(): fix UAF for rx_kref of j1939_priv It will trigger UAF for rx_kref of j1939_priv as following. cpu0 cpu1 j1939_sk_bind(socket0, ndev0, ...) j1939_netdev_start j1939_sk_bind(socket1, ndev0, ...) j1939_netdev_start j1939_priv_set j1939_priv_get_by_ndev_locked j1939_jsk_add ..... j1939_netdev_stop kref_put_lock(&priv->rx_kref, ...) kref_get(&priv->rx_kref, ...) REFCOUNT_WARN("addition on 0;...") ==================================================== refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 20874 at lib/refcount.c:25 refcount_warn_saturate+0x169/0x1e0 RIP: 0010:refcount_warn_saturate+0x169/0x1e0 Call Trace: j1939_netdev_start+0x68b/0x920 j1939_sk_bind+0x426/0xeb0 ? security_socket_bind+0x83/0xb0 The rx_kref's kref_get() and kref_put() should use j1939_netdev_lock to protect.

AI-Powered Analysis

AILast updated: 06/30/2025, 13:25:16 UTC

Technical Analysis

CVE-2021-47459 is a use-after-free (UAF) vulnerability found in the Linux kernel's CAN (Controller Area Network) J1939 protocol implementation, specifically within the j1939_netdev_start() function. The vulnerability arises due to improper reference counting on the rx_kref field of the j1939_priv structure. The flaw occurs when concurrent operations on multiple CPUs cause a race condition between incrementing (kref_get) and decrementing (kref_put) the reference count without proper locking. This leads to a scenario where the reference count can be incremented after it has reached zero, triggering a use-after-free condition. The root cause is the lack of synchronization using the j1939_netdev_lock when manipulating rx_kref, which results in a refcount_warn_saturate warning and potential memory corruption. Exploiting this vulnerability could allow an attacker to execute arbitrary code or cause a denial of service by crashing the kernel. The vulnerability affects specific Linux kernel versions identified by commit hashes and was publicly disclosed on May 22, 2024. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a significant risk particularly to those using Linux-based systems in environments where the CAN J1939 protocol is relevant, such as automotive, industrial control systems, and embedded devices. Exploitation could lead to kernel crashes, resulting in denial of service, or potentially privilege escalation if an attacker can execute arbitrary code in kernel space. This could disrupt critical infrastructure, manufacturing operations, or automotive systems relying on Linux. Given the widespread use of Linux in servers, IoT devices, and embedded systems across Europe, the impact could extend to sectors including automotive manufacturing hubs (e.g., Germany), industrial automation, and transportation. The absence of known exploits reduces immediate risk, but the vulnerability's nature means that targeted attacks could emerge, especially in high-value sectors.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the latest Linux kernel patches that address CVE-2021-47459 as soon as they become available, ensuring the j1939_netdev_lock is properly used to protect rx_kref reference counting. 2) For systems where immediate patching is not feasible, consider disabling the CAN J1939 protocol module if it is not required, to reduce the attack surface. 3) Implement kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and Kernel Page Table Isolation (KPTI) to make exploitation more difficult. 4) Monitor system logs for refcount_warn_saturate warnings or unusual kernel messages that might indicate attempted exploitation. 5) Employ strict access controls and network segmentation to limit exposure of vulnerable systems, especially those interfacing with CAN networks. 6) Engage in proactive vulnerability management and testing, including fuzzing and static analysis, to detect similar race conditions in custom or vendor kernels.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-22T06:20:56.197Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9833c4522896dcbe91d6

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

Last enriched: 6/30/2025, 1:25:16 PM

Last updated: 7/31/2025, 3:39:09 PM

Views: 12

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