tls: fix missing memory barrier in tls_init
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d5bee7374b68de3c44586d46e9e61ffc97a1e886 · < 91e61dd7a0af660408e87372d8330ceb218be302| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
A missing memory barrier in the Linux kernel's TLS initialization can expose an uninitialized pointer to TLS socket-option handlers. Under store-store reordering, this can cause a NULL dereference; the input does not specify whether exploitation requires local or network access, authentication, or user interaction.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified.