nfc: llcp: read llcp_sock->local under the socket lock in getsockopt
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 26fd76cab2e61cedc5c25f7151fb31b57ddc53c7 · < 156e65bd29307f5053835bff60bc1ba342fa010f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: llcp: read llcp_sock->local under the socket lock in getsockopt
nfc_llcp_getsockopt() read llcp_sock->local before lock_sock(sk) and then dereferenced the cached pointer inside the locked region. llcp_sock_bind() assigns and clears llcp_sock->local under the same socket lock, dropping the last reference on its error path. A getsockopt() racing an in-flight bind() can observe the pointer, block on lock_sock(), and then dereference a freed nfc_llcp_local once bind() has unwound.
Move the llcp_sock->local read and the NULL check inside the lock_sock(sk) region so bind() cannot mutate or free the pointer between the load and the use.
From the CVE record · Linux
The Linux kernel’s NFC LLCP getsockopt path can read a socket pointer before taking the socket lock. A local process that races getsockopt() with bind() can cause the pointer to be dereferenced after it has been freed.
Engineers running Linux kernels with NFC LLCP support should check whether their kernel includes the fix; affected versions were not provided.