net: Fix TOCTOU issue in sk_is_readable()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8934ce2fd08171e8605f7fada91ee7619fe17ab8 · < 1b367ba2f94251822577daed031d6b9a9e11ba91| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's sk_is_readable() has a race when a socket is removed from a sockmap and its function pointer is restored. This can lead to a null pointer dereference. The input does not specify how an attacker could trigger the race or whether authentication or user interaction is needed.
Engineers running the Linux kernel should check their versions; affected versions are not specified.