KernelScan.io

HIGH Introduced in 3.7

nfc AcceptQueue UAF

CVE-2026-98580

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 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.

02

Engine v0.9.0

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.

Affectednet/nfc/llcp_core.c, net/nfc/llcp_sock.c (NFC LLCP subsystem)

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.

03

BranchIntroducedFixed inPatch commit
5.103.75.10.27154adcabb0f1d
5.153.75.15.2227c938aad5108
6.13.76.1.189d2093a098113
6.123.76.12.11253867f6acb1a
6.183.76.18.55da8a07757383
6.63.76.6.15841256821762a
7.23.77.2.9d5e1c92d09ca
mainline3.77.3c3eef2f988a3
cip/5.103.75.10.271-cip7854adcabb0f1d
cip/5.10-rt3.75.10.272-cip79-rt3554adcabb0f1d
cip/6.13.76.1.189-cip61d2093a098113
cip/6.1-rt3.76.1.189-cip61-rt32d2093a098113
cip/6.123.76.12.112-cip3353867f6acb1a

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-cip137)
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)