CVE-2024-36489: tls: fix missing memory barrier in tls_init
In the Linux kernel, the following vulnerability has been resolved:
tls: fix missing memory barrier in tlsinit
In tlsinit(), a write memory barrier is missing, and store-store reordering may cause NULL dereference in tls{setsockopt,getsockopt}.
CPU0 CPU1 ----- ----- // In tlsinit() // In tlsctxcreate() ctx = kzalloc() ctx->skproto = READONCE(sk->skprot) -(1)
// In updateskprot() WRITEONCE(sk->skprot, tlsprots) -(2)
// In sockcommonsetsockopt() READONCE(sk->skprot)->setsockopt()
// In tls{setsockopt,getsockopt}() ctx->skproto->setsockopt() -(3)
In the above scenario, when (1) and (2) are reordered, (3) can observe the NULL value of ctx->skproto, causing NULL dereference.
To fix it, we rely on rcuassignpointer() which implies the release barrier semantic. By moving rcuassignpointer() after ctx->skproto is initialized, we can ensure that ctx->skproto are visible when changing sk->skprot.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
tls: fix missing memory barrier in tlsinit
The Linux kernel CVE team has assigned CVE-2024-36489 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024062136-CVE-2024-36489-7213@gregkh/T
— Red Hat
Linux Kernel is vulnerable to a denial of service, caused by missing memory barrier in tlsinit. A local authenticated attacker could exploit this vulnerability to cause a denial of service.
— IBM
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-36489?
CVE-2024-36489 is rated as a high severity vulnerability due to the potential for NULL dereference in specific TLS operations.
How do I fix CVE-2024-36489?
To fix CVE-2024-36489, upgrade your Linux kernel to version 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.128-1, 6.12.12-1, or 6.12.13-1 as recommended.
Which Linux kernel versions are affected by CVE-2024-36489?
CVE-2024-36489 affects Linux kernel versions prior to 5.10.219, 5.15.161, 6.1.93, 6.6.33, 6.9.4, and 6.10.
What are the specific operations that may lead to a vulnerability in CVE-2024-36489?
The vulnerability in CVE-2024-36489 may cause NULL dereference during tls_{setsockopt, getsockopt} due to missing memory barriers.
Is there a workaround for CVE-2024-36489?
There are no known workarounds for CVE-2024-36489; the recommended action is to apply the necessary kernel updates.