CVE-2025-38112
JSON

4.7medium

net: Fix TOCTOU issue in sk_is_readable()

Severity
4.7medium CVSS:3.1 by NVD
Exploit likelihood
0.20% (higher than 6% of CVEs)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: Fix TOCTOU issue in sk_is_readable() sk->sk_prot->sock_is_readable is a valid function pointer when sk resides in a sockmap. After the last sk_psock_put() (which usually happens when socket is removed from sockmap), sk->sk_prot gets restored and sk->sk_prot->sock_is_readable becomes NULL. This makes sk_is_readable() racy, if the value of sk->sk_prot is reloaded after the initial check. Which in turn may lead to a null pointer dereference. Ensure the function pointer does not turn NULL after the check.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before c2b26638476baee154920bb587fc94ff1bf04336, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before 6fa68d7eab34d448a61aa24ea31e68b3231ed20d, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before 8926a7ef1977a832dd6bf702f1a99303dbf15b15, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before ff55c85a923e043d59d26b20a673a1b4a219c310, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before 1e0de7582ceccbdbb227d4e0ddf65732f92526da, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before 1b367ba2f94251822577daed031d6b9a9e11ba91, from 8934ce2fd08171e8605f7fada91ee7619fe17ab8 before 2660a544fdc0940bba15f70508a46cf9a6491230, 4.17
Not affected: before 4.17, from 5.10.239 up to 5.10.*, from 5.15.186 up to 5.15.*, from 6.1.142 up to 6.1.*, from 6.6.94 up to 6.6.*, from 6.12.34 up to 6.12.*
CVE List
linux linux_kernelfrom 4.17 before 5.10.239, from 5.11 before 5.15.186, from 5.16 before 6.1.142, from 6.2 before 6.6.94, from 6.7 before 6.12.34, from 6.13 before 6.15.3, 6.16NVD
debian debian_linux11.0NVD

Classification

CWE-367

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: net: Fix TOCTOU issue in sk_is_readable() sk->sk_prot->sock_is_readable is a valid function pointer when sk resides in a sockmap. After the last sk_psock_put() (which usually happens when socket is removed from sockmap), sk->sk_prot gets restored and sk->sk_prot->sock_is_readable becomes NULL. This makes sk_is_readable() racy, if the value of sk->sk_prot is reloaded after the initial check. Which in turn may lead to a null pointer dereference. Ensure the function pointer does not turn NULL after the check.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: Se solucionó el problema de TOCTOU en sk_is_readable(). sk->sk_prot->sock_is_readable es un puntero a función válido cuando sk reside en un mapa de sockets. Tras el último sk_psock_put() (que suele ocurrir al eliminar un socket de un mapa de sockets), sk->sk_prot se restaura y sk->sk_prot->sock_is_readable se convierte en NULL. Esto hace que sk_is_readable() sea arriesgado si el valor de sk->sk_prot se recarga después de la comprobación inicial. Esto, a su vez, puede provocar una desreferencia de puntero nulo. Asegúrese de que el puntero a función no se convierta en NULL después de la comprobación.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-38112 changed 2026-11-05CVE Terms of Use
NVDCVE-2025-38112 changed 2026-11-05Public domain