net: Fix TOCTOU issue in sk_is_readable() (Linux Linux)

CVE-2025-38112
MEDIUM 4.7

At a glance

Source
NVD
EPSS
EPSS 0.14 % · percentile 4 ()
State
PUBLISHED
Published
Updated
Assigner
Linux
NVD status
Analyzed

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.

Weaknesses (CWE)

  • CWE-367 — Time-of-check Time-of-use (TOCTOU) Race Condition

References

Scores

VersionScoreVectorScored by
CVSS 3.1MEDIUM 4.7CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:HNVD · nvd@nist.gov (Primary)

European references

CERT-FR advisories

Affected configurations (NVD CPE)

Affected products

ProductVersions
Linux · Linuxaffected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < c2b26638476baee154920bb587fc94ff1bf04336 ; affected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < 6fa68d7eab34d448a61aa24ea31e68b3231ed20d ; affected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < 8926a7ef1977a832dd6bf702f1a99303dbf15b15 ; affected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < ff55c85a923e043d59d26b20a673a1b4a219c310 ; affected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < 1e0de7582ceccbdbb227d4e0ddf65732f92526da ; affected 8934ce2fd08171e8605f7fada91ee7619fe17ab8 < 1b367ba2f94251822577daed031d6b9a9e11ba91
Linux · Linuxaffected 4.17 ; unaffected 0 < 4.17 ; unaffected 5.10.239 ≤ 5.10.* ; unaffected 5.15.186 ≤ 5.15.* ; unaffected 6.1.142 ≤ 6.1.* ; unaffected 6.6.94 ≤ 6.6.*

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD