KernelScan.io

HIGH Introduced in 3.6

nfc ConnectingSocket Race

CVE-2026-98581

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: nfc: llcp: Fix list corruption / refcount desync in nfc_llcp_recv_dm() nfc_llcp_recv_dm() handles DM(NOBOUND)/DM(REJ) for a socket that is still linked on local->connecting_sockets: it looks the socket up with nfc_llcp_connecting_sock_get(), sets sk->sk_state = LLCP_CLOSED and returns, without taking the socket lock and without unlinking the socket from the connecting_sockets list. llcp_sock_release() selects the list to unlink from by sk_state: a socket in LLCP_CONNECTING is unlinked from connecting_sockets, otherwise from the sockets list. Because recv_dm left the socket physically on connecting_sockets but in the LLCP_CLOSED state, release() takes the else branch and calls nfc_llcp_sock_unlink(&local->sockets, sk). That runs sk_del_node_init() while holding sockets.lock, i.e. it removes the socket from the connecting_sockets hlist under the wrong lock. A concurrent connect() linking another socket onto connecting_sockets under connecting_sockets.lock then mutates the same hlist unserialized, which corrupts the list and desyncs the sk_add_node()/sk_del_node_init() sock_hold()/__sock_put() pairing. An unprivileged local process holding LLCP sockets, with the DM supplied by the remote peer over an established LLCP link, can drive this to leak kernel sockets without bound (the mis-decrement goes through the non-freeing __sock_put() path, so the object is never released), leading to memory exhaustion / DoS. This is the same class of bug that was fixed in the sibling handler nfc_llcp_recv_cc() by commit b493ea2765cc ("nfc: llcp: Fix use-after-free race in nfc_llcp_recv_cc()"); recv_dm did not receive the equivalent fix. Fix it the same way: take lock_sock(), re-check that the socket is still hashed (release() may have won the race), and for the NOBOUND/REJ case unlink it from connecting_sockets before moving it to LLCP_CLOSED. The unlink drops the connecting_sockets membership reference via sk_del_node_init(), leaving the socket unhashed, so the later nfc_llcp_sock_unlink() in llcp_sock_release() becomes a no-op and no double put occurs.

02

Engine v0.9.0

Risk summary

An unprivileged local user with access to NFC LLCP sockets can trigger a race condition by receiving a DM(NOBOUND) or DM(REJ) packet from a remote peer. This corrupts a kernel socket list and desynchronizes reference counts, causing unbounded kernel socket leaks that exhaust memory and deny service. The bug is reachable on any system with NFC hardware and the LLCP protocol stack enabled.

Affectednet/nfc/llcp_core.c (nfc llcp subsystem)

Vulnerability analysis

When the NFC LLCP layer receives a DM(NOBOUND) or DM(REJ) response for a socket that is still in the connecting state, the handler marks the socket closed but leaves it linked on the connecting_sockets list without taking the socket lock. Later, when the socket is released, the cleanup code consults the socket state — now CLOSED — and attempts to unlink it from the main sockets list instead, operating on the wrong list under the wrong lock. A concurrent connection attempt can then mutate the connecting_sockets list unsynchronized, corrupting the list and breaking the reference-count pairing. This leaks kernel socket structures indefinitely, leading to memory exhaustion. The fix acquires the socket lock, verifies the socket is still hashed, and explicitly unlinks it from connecting_sockets before transitioning to CLOSED, mirroring the existing fix for the similar CC handler.

03

BranchIntroducedFixed inPatch commit
5.103.65.10.271dd2d24add86b
5.153.65.15.222812731dd8511
6.13.66.1.189dba1d9c7134a
6.123.66.12.1127fb2c0eeb79b
6.183.66.18.55b94cf0972054
6.63.66.6.158c1e9ed52a669
7.23.67.2.9320a2ff49bdc
mainline3.67.3bf1460acdf8c
cip/5.103.65.10.271-cip78dd2d24add86b
cip/5.10-rt3.65.10.272-cip79-rt35dd2d24add86b
cip/6.13.66.1.189-cip61dba1d9c7134a
cip/6.1-rt3.66.1.189-cip61-rt32dba1d9c7134a
cip/6.123.66.12.112-cip337fb2c0eeb79b

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.112-cip33
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtFixed in 5.10.272-cip79-rt35
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)