HIGH Introduced in 3.7
nfc AcceptQueue UAF
CVE-2026-98580
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: nfc: llcp: Fix race condition in accept_queue lifecycle In nfc_llcp_socket_release(), sockets and listener accept queues are walked under the local sockets rwlock and bh_lock_sock(). However, bh_lock_sock() does not synchronise against process-context lock_sock() held by nfc_llcp_accept_dequeue() during accept(). Because socket_release() does not check sock_owned_by_user(), both paths can concurrently unlink and release the same child socket, resulting in use-after-free or a NULL pointer dereference of child->parent in nfc_llcp_accept_unlink(). Fix this synchronisation race by having nfc_llcp_socket_release() use process-context lock_sock() instead of bh_lock_sock(): 1. Pop sockets from the local sockets list under the write lock using nfc_llcp_sock_list_pop() so lock_sock() can be acquired without holding the rwlock. 2. Because lock_sock() can sleep, defer the final release of the nfc_llcp_local structure to a workqueue (release_work). This avoids a sleeping-in-atomic bug when the last local reference is dropped from softirq context. Additionally, hold a single device reference on local from registration until final destruction. 3. In nfc_llcp_local_get(), use kref_get_unless_zero() to prevent resurrecting a local object whose teardown has been scheduled. 4. In llcp_sock_accept(), verify that the listener socket state is still LLCP_LISTEN after waking from schedule_timeout() to prevent hangs if the listener is closed concurrently. 5. When unlinking unaccepted child sockets during listener release, unlink them from local->sockets, call sock_orphan(), and drop their initial sk_alloc creation reference via sock_put(). 6. Make nfc_llcp_accept_unlink() idempotent by guarding parent access with a NULL check.
02KernelScan AI Analysis
Risk summary
A local attacker with access to NFC hardware can trigger a race condition between socket release and accept operations, leading to use-after-free and potential kernel privilege escalation. The bug is reachable from unprivileged user namespaces with CAP_NET_ADMIN, making it a container escape vector on systems with NFC controllers.
Vulnerability analysis
The NFC LLCP subsystem's socket release path used a bottom-half lock (bh_lock_sock) that does not synchronize with the process-context lock (lock_sock) held during accept(). This allows two threads — one closing a listener socket and another dequeuing an accepted connection — to simultaneously unlink and free the same child socket, causing a use-after-free or NULL pointer dereference. The fix replaces the locking strategy: sockets are now popped from the list under a write lock, then locked with process-context lock_sock() without holding the rwlock. Because lock_sock() can sleep, final cleanup of the local NFC structure is deferred to a workqueue. Additional guards include kref_get_unless_zero() to prevent object resurrection, state verification after schedule_timeout(), proper orphaning and reference dropping of unaccepted children, and an idempotent unlink function. An attacker needs local access and the ability to create NFC LLCP sockets (typically via CAP_NET_ADMIN in a user namespace), and must win a tight race window between release and accept paths.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 3.7 | 5.10.271 | 54adcabb0f1d |
| 5.15 | 3.7 | 5.15.222 | 7c938aad5108 |
| 6.1 | 3.7 | 6.1.189 | d2093a098113 |
| 6.12 | 3.7 | 6.12.112 | 53867f6acb1a |
| 6.18 | 3.7 | 6.18.55 | da8a07757383 |
| 6.6 | 3.7 | 6.6.158 | 41256821762a |
| 7.2 | 3.7 | 7.2.9 | d5e1c92d09ca |
| mainline | 3.7 | 7.3 | c3eef2f988a3 |
| cip/5.10 | 3.7 | 5.10.271-cip78 | 54adcabb0f1d |
| cip/5.10-rt | 3.7 | 5.10.272-cip79-rt35 | 54adcabb0f1d |
| cip/6.1 | 3.7 | 6.1.189-cip61 | d2093a098113 |
| cip/6.1-rt | 3.7 | 6.1.189-cip61-rt32 | d2093a098113 |
| cip/6.12 | 3.7 | 6.12.112-cip33 | 53867f6acb1a |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |