CVE-2024-36489

CVSS v3.1 5.5 (Medium)
55% Progress
EPSS 0.04 % (5th)
0.04% Progress
Affected Products 1
Advisories 18
NVD Status Analyzed

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.

Weaknesses
CWE-476
NULL Pointer Dereference
CVE Status
PUBLISHED
NVD Status
Analyzed
CNA
kernel.org
Published Date
2024-06-21 11:15:10
(2 months ago)
Updated Date
2024-09-09 13:32:13
(7 days ago)

Affected Products

Loading...
Loading...

Configuration #1

    CPE23 From Up To
  Linux Kernel from 5.7 version and prior 5.10.219 version cpe:2.3:o:linux:linux_kernel >= 5.7 < 5.10.219
  Linux Kernel from 5.11 version and prior 5.15.161 version cpe:2.3:o:linux:linux_kernel >= 5.11 < 5.15.161
  Linux Kernel from 5.16 version and prior 6.1.93 version cpe:2.3:o:linux:linux_kernel >= 5.16 < 6.1.93
  Linux Kernel from 6.2 version and prior 6.6.33 version cpe:2.3:o:linux:linux_kernel >= 6.2 < 6.6.33
  Linux Kernel from 6.7 version and prior 6.9.4 version cpe:2.3:o:linux:linux_kernel >= 6.7 < 6.9.4
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...