nfc: llcp: add missing return after LLCP_CLOSED checks
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d646960f7986fefb460a2b062d5ccc8ccfeacc3a · < 8977fad2b3c6eefd414131168d597c5d1d5e1abf| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: llcp: add missing return after LLCP_CLOSED checks
In nfc_llcp_recv_hdlc() and nfc_llcp_recv_disc(), when the socket state is LLCP_CLOSED, the code correctly calls release_sock() and nfc_llcp_sock_put() but fails to return. Execution falls through to the remainder of the function, which calls release_sock() and nfc_llcp_sock_put() again. This results in a double release_sock() and a refcount underflow via double nfc_llcp_sock_put(), leading to a use-after-free.
Add the missing return statements after the LLCP_CLOSED branches in both functions to prevent the fall-through.
From the CVE record · Linux
The Linux kernel’s NFC LLCP receive functions fail to return after handling a closed socket. If processing reaches that branch, the functions release the socket twice, causing a reference-count underflow and use-after-free. The input does not specify how an attacker could trigger this condition or whether authentication or user interaction is required.
Engineers running Linux kernels with NFC LLCP support should check their versions; affected versions are not specified.