First published: Fri Jun 21 2024(Updated: )
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.
Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Affected Software | Affected Version | How to fix |
---|---|---|
Linux Linux kernel | >=5.7<5.10.219 | |
Linux Linux kernel | >=5.11<5.15.161 | |
Linux Linux kernel | >=5.16<6.1.93 | |
Linux Linux kernel | >=6.2<6.6.33 | |
Linux Linux kernel | >=6.7<6.9.4 | |
redhat/kernel | <5.10.219 | 5.10.219 |
redhat/kernel | <5.15.161 | 5.15.161 |
redhat/kernel | <6.1.93 | 6.1.93 |
redhat/kernel | <6.6.33 | 6.6.33 |
redhat/kernel | <6.9.4 | 6.9.4 |
redhat/kernel | <6.10 | 6.10 |
debian/linux | 5.10.223-1 5.10.226-1 6.1.115-1 6.1.119-1 6.11.10-1 6.12.5-1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.