Skip to main content

CVE-2024-36489: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-36489cvecve-2024-36489
Published: Fri Jun 21 2024 (06/21/2024, 10:18:10 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: tls: fix missing memory barrier in tls_init In tls_init(), a write memory barrier is missing, and store-store reordering may cause NULL dereference in tls_{setsockopt,getsockopt}. CPU0 CPU1 ----- ----- // In tls_init() // In tls_ctx_create() ctx = kzalloc() ctx->sk_proto = READ_ONCE(sk->sk_prot) -(1) // In update_sk_prot() WRITE_ONCE(sk->sk_prot, tls_prots) -(2) // In sock_common_setsockopt() READ_ONCE(sk->sk_prot)->setsockopt() // In tls_{setsockopt,getsockopt}() ctx->sk_proto->setsockopt() -(3) In the above scenario, when (1) and (2) are reordered, (3) can observe the NULL value of ctx->sk_proto, causing NULL dereference. To fix it, we rely on rcu_assign_pointer() which implies the release barrier semantic. By moving rcu_assign_pointer() after ctx->sk_proto is initialized, we can ensure that ctx->sk_proto are visible when changing sk->sk_prot.

AI-Powered Analysis

AILast updated: 06/29/2025, 09:41:49 UTC

Technical Analysis

CVE-2024-36489 is a vulnerability identified in the Linux kernel's TLS (Transport Layer Security) implementation, specifically within the tls_init() function. The root cause is a missing write memory barrier, which leads to potential store-store reordering on multi-CPU systems. This reordering can cause a NULL pointer dereference in the tls_setsockopt() and tls_getsockopt() functions. The vulnerability arises when one CPU initializes a TLS context structure (ctx) and assigns a pointer (ctx->sk_proto) to a socket protocol structure (sk->sk_prot) without enforcing proper memory ordering. Concurrently, another CPU may update sk->sk_prot, and due to the lack of a memory barrier, the read operation in tls_setsockopt() or tls_getsockopt() may observe a NULL value for ctx->sk_proto. This results in a NULL pointer dereference, which can cause a kernel crash (denial of service). The fix involves using rcu_assign_pointer(), which provides release barrier semantics, ensuring that the initialization of ctx->sk_proto is visible before updating sk->sk_prot, thus preventing the reordering and subsequent NULL dereference. This vulnerability affects Linux kernel versions identified by the commit hash d5bee7374b68de3c44586d46e9e61ffc97a1e886 and potentially other versions sharing this code path. No known exploits are reported in the wild as of the publication date (June 21, 2024).

Potential Impact

The primary impact of CVE-2024-36489 is a potential denial of service (DoS) condition caused by a kernel NULL pointer dereference leading to a system crash. For European organizations, especially those relying on Linux-based servers, network appliances, or embedded systems that utilize the kernel's TLS stack for secure communications, this vulnerability could disrupt critical services. The TLS implementation is often used in secure network communications, including VPNs, web servers, and other encrypted channels. A crash in the kernel could lead to downtime, loss of availability, and potential cascading effects on dependent services. Although this vulnerability does not directly lead to privilege escalation or data leakage, the resulting DoS could be exploited by attackers to disrupt operations or as part of a larger attack chain. Given the widespread use of Linux in European data centers, cloud infrastructures, and telecommunications, the impact could be significant if exploited at scale or in targeted attacks against critical infrastructure.

Mitigation Recommendations

To mitigate CVE-2024-36489, European organizations should: 1) Apply the official Linux kernel patches that incorporate the fix using rcu_assign_pointer() to enforce proper memory barriers. This is the definitive solution to prevent the race condition causing the NULL dereference. 2) Prioritize patching on systems that handle TLS operations at the kernel level, such as servers running kernel TLS offloading or network devices using Linux-based firmware. 3) Monitor kernel crash logs and system stability metrics for signs of NULL pointer dereference or unexpected reboots, which may indicate exploitation attempts or triggering of this bug. 4) Employ kernel live patching solutions where available to reduce downtime during patch deployment, especially in production environments. 5) Limit exposure by restricting access to systems running vulnerable kernels, particularly from untrusted networks, to reduce the risk of remote triggering. 6) Conduct thorough testing of updated kernels in staging environments to ensure compatibility and stability before wide deployment. 7) Maintain up-to-date inventory of Linux kernel versions in use across the organization to identify and remediate vulnerable instances promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-21T10:12:11.459Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9828c4522896dcbe255e

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

Last enriched: 6/29/2025, 9:41:49 AM

Last updated: 8/4/2025, 1:06:43 AM

Views: 14

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